Skip to content

Commit

Permalink
fix: reload NMRium with the last selected workspace
Browse files Browse the repository at this point in the history
close #1453
  • Loading branch information
hamed-musallam committed Mar 31, 2022
1 parent 46c4aa2 commit cb52cdc
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions src/component/reducer/preferencesReducer.ts
Expand Up @@ -221,20 +221,28 @@ function handleInit(draft: Draft<PreferencesState>, action) {
))) ||
!localData
) {
const { workspaces, version } = draft || {};
const {
workspaces,
version,
workspace: { current },
} = draft || {};
const display = filterObject(workspacePreferences.display);

const data = {
version,
...(localData?.currentWorkspace && {
currentWorkspace: localData?.currentWorkspace,
}),
workspaces: {
...workspaces,
[draft.workspace.current]: {
[current]: {
...workspacePreferences,
display,
},
},
};
draft.workspaces[draft.workspace.current] = lodashMerge(

draft.workspaces[current] = lodashMerge(
{},
currentWorkspacePreferences,
workspacePreferences,
Expand Down

0 comments on commit cb52cdc

Please sign in to comment.