diff --git a/apps/web/src/components/editor/manager.ts b/apps/web/src/components/editor/manager.ts index 0d62e79f8..bd540db90 100644 --- a/apps/web/src/components/editor/manager.ts +++ b/apps/web/src/components/editor/manager.ts @@ -50,7 +50,7 @@ class EditorManager extends BaseStore { zoom: EDITOR_ZOOM.DEFAULT, lineHeight: EDITOR_LINE_HEIGHT.DEFAULT }); - editors: Record = {}; + editors: Record = {}; getEditor = (id: string): EditorContext | undefined => { return this.get().editors[id]; diff --git a/apps/web/src/dialogs/command-palette/commands.ts b/apps/web/src/dialogs/command-palette/commands.ts index 037a5eca6..49b41be60 100644 --- a/apps/web/src/dialogs/command-palette/commands.ts +++ b/apps/web/src/dialogs/command-palette/commands.ts @@ -432,7 +432,7 @@ function getEditorCommands(): Command[] { } ]; - if (session.type !== "readonly" && (editor.canUndo || editor.canRedo)) { + if (session.type !== "readonly" && (editor?.canUndo || editor?.canRedo)) { commands.push( { id: "undo",