merge recovered app state with default app state (makes a difference if the recovered app state is only partially defined)

This commit is contained in:
Joeri Exelmans 2025-11-08 10:36:42 +01:00
parent 9922f8588d
commit e0863c9443
2 changed files with 2 additions and 2 deletions

View file

@ -68,7 +68,7 @@ export function App() {
if (recoveredState.editorState !== undefined) { if (recoveredState.editorState !== undefined) {
const {editorState, ...appState} = recoveredState as AppState & {editorState: VisualEditorState}; const {editorState, ...appState} = recoveredState as AppState & {editorState: VisualEditorState};
setEditHistory(() => ({current: editorState, history: [], future: []})); setEditHistory(() => ({current: editorState, history: [], future: []}));
setAppState(() => appState); setAppState(defaultAppState => Object.assign({}, defaultAppState, appState));
} }
} }
}, },

View file

@ -45,7 +45,7 @@ export const defaultSideBarState = {
showInputEvents: true, showInputEvents: true,
showInternalEvents: true, showInternalEvents: true,
showOutputEvents: true, showOutputEvents: true,
showPlant: false, showPlant: true,
showConnections: false, showConnections: false,
showProperties: false, showProperties: false,
showExecutionTrace: true, showExecutionTrace: true,