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) {
const {editorState, ...appState} = recoveredState as AppState & {editorState: VisualEditorState};
setEditHistory(() => ({current: editorState, history: [], future: []}));
setAppState(() => appState);
setAppState(defaultAppState => Object.assign({}, defaultAppState, appState));
}
}
},