Skip to content

Commit 94ccd53

Browse files
authored
fix: store panel state properly in local storage. (#156)
1 parent 9d8cc13 commit 94ccd53

File tree

3 files changed

+3
-2
lines changed

3 files changed

+3
-2
lines changed

web/src/services/config.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,7 @@ const Config = {
164164
},
165165

166166
saveObject<T>(key: string, value: T) {
167+
this._cache[key] = value;
167168
localStorage.setItem(key, JSON.stringify(value));
168169
},
169170

web/src/store/dispatch.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ export const dispatchToggleTheme: Dispatcher =
195195
export const dispatchPanelLayoutChange = (changes: Partial<PanelState>): Dispatcher => (
196196
(dispatch: DispatchFn, getState: StateProvider) => {
197197
const { panel } = getState();
198-
config.panelLayout = { ...config.panelLayout, ...panel };
198+
config.panelLayout = { ...panel, ...changes };
199199
dispatch(newPanelStateChangeAction(changes));
200200
}
201201
);

web/src/store/reducers.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ export const getInitialState = (): State => ({
148148
useSystemTheme: localConfig.useSystemTheme,
149149
},
150150
monaco: config.monacoSettings,
151-
panel: defaultPanelProps
151+
panel: localConfig.panelLayout
152152
});
153153

154154
export const createRootReducer = history => combineReducers({

0 commit comments

Comments
 (0)