Changed currentState update func to the not reset constants state

This commit is contained in:
Muhsin Shah 2024-05-23 19:32:02 +05:30
parent 0e76205a88
commit 7a6068d7be

View file

@ -55,7 +55,14 @@ export const useCurrentStateStore = create(
},
setEditorReady: (isEditorReady) => set({ isEditorReady }),
initializeCurrentStateOnVersionSwitch: () => {
set({ ...initialState }, false, { type: 'INITIALIZE_CURRENT_STATE_ON_VERSION_SWITCH', initialState });
const newInitialState = {
...initialState,
constants: get().constants,
};
set({ ...newInitialState }, false, {
type: 'INITIALIZE_CURRENT_STATE_ON_VERSION_SWITCH',
newInitialState,
});
},
},
}),