Skip to content

Commit

Permalink
Only run if electron
Browse files Browse the repository at this point in the history
  • Loading branch information
belcherj committed Jul 30, 2020
1 parent fb2b90f commit 414a93a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/note-content-editor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ class NoteContentEditor extends Component<Props> {
}

componentWillUnmount() {
window?.electron.removeListener('editorCommand');
window.removeEventListener('keydown', this.handleKeys, true);
}

Expand Down Expand Up @@ -158,7 +159,7 @@ class NoteContentEditor extends Component<Props> {
window.monaco = monaco;
this.editor = editor;

window.electron.receive('appCommand', (command) => {
window?.electron.receive('editorCommand', (command) => {
switch (command.action) {
case 'redo':
editor.trigger('', 'redo');
Expand Down

0 comments on commit 414a93a

Please sign in to comment.