diff --git a/src/renderer/commands/index.js b/src/renderer/commands/index.js index 0966dc55..c93b457c 100644 --- a/src/renderer/commands/index.js +++ b/src/renderer/commands/index.js @@ -76,7 +76,7 @@ const commands = [ description: 'File: Print current Tab', execute: async () => { await delay(50) - ipcRenderer.emit('mt::show-export-dialog', null, 'print') + bus.$emit('showExportDialog', 'print') } }, { id: 'file.close-tab', @@ -125,14 +125,14 @@ const commands = [ description: 'HTML', execute: async () => { await delay(50) - bus.$emit('export', 'styledHtml') + bus.$emit('showExportDialog', 'styledHtml') } }, { id: 'file.export-file-pdf', description: 'PDF', execute: async () => { await delay(50) - bus.$emit('export', 'pdf') + bus.$emit('showExportDialog', 'pdf') } }] }, @@ -144,13 +144,17 @@ const commands = [ id: 'edit.undo', description: 'Edit: Undo', execute: async () => { - bus.$emit('undo', 'undo') + focusEditorAndExecute( + () => bus.$emit('undo', 'undo') + ) } }, { id: 'edit.redo', description: 'Edit: Redo', execute: async () => { - bus.$emit('redo', 'redo') + focusEditorAndExecute( + () => bus.$emit('redo', 'redo') + ) } }, { id: 'edit.duplicate', @@ -616,13 +620,17 @@ const commands = [ id: 'view.typewriter-mode', description: 'View: Toggle Typewriter Mode', execute: async () => { - bus.$emit('view:toggle-view-entry', 'typewriter') + focusEditorAndExecute( + () => bus.$emit('view:toggle-view-entry', 'typewriter') + ) } }, { id: 'view.focus-mode', description: 'View: Focus Mode', execute: async () => { - bus.$emit('view:toggle-view-entry', 'focus') + focusEditorAndExecute( + () => bus.$emit('view:toggle-view-entry', 'focus') + ) } }, { id: 'view.toggle-sidebar',