Skip to content

A fully open source & end-to-end encrypted note taking alternative to Evernote.

web: fix empty command palette/quick open when locked note active (#9200)

01zulfia6032ffd7231
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<EditorManager> {
zoom: EDITOR_ZOOM.DEFAULT,
lineHeight: EDITOR_LINE_HEIGHT.DEFAULT
});
- editors: Record<string, EditorContext> = {};
+ editors: Record<string, EditorContext | undefined> = {};
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",