From 414a93a70ce481370f935d94e62916c819cdc66b Mon Sep 17 00:00:00 2001 From: "Jonathan (JB) Belcher" Date: Thu, 30 Jul 2020 11:49:21 -0400 Subject: [PATCH] Only run if electron --- lib/note-content-editor.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/note-content-editor.tsx b/lib/note-content-editor.tsx index 7f9b9128e..4b0fd7b5f 100644 --- a/lib/note-content-editor.tsx +++ b/lib/note-content-editor.tsx @@ -84,6 +84,7 @@ class NoteContentEditor extends Component { } componentWillUnmount() { + window?.electron.removeListener('editorCommand'); window.removeEventListener('keydown', this.handleKeys, true); } @@ -158,7 +159,7 @@ class NoteContentEditor extends Component { window.monaco = monaco; this.editor = editor; - window.electron.receive('appCommand', (command) => { + window?.electron.receive('editorCommand', (command) => { switch (command.action) { case 'redo': editor.trigger('', 'redo');