diff --git a/ts/mains/main_node.ts b/ts/mains/main_node.ts index 8dc4a6c36..580abaf48 100644 --- a/ts/mains/main_node.ts +++ b/ts/mains/main_node.ts @@ -649,7 +649,7 @@ async function showAbout() { aboutWindow?.show(); } -async function saveDebugLog(_event: any, additionalInfo: string) { +async function saveDebugLog(_event: any, additionalInfo?: string) { const options: Electron.SaveDialogOptions = { title: 'Save debug log', defaultPath: path.join( @@ -799,6 +799,7 @@ function setupMenu() { const { platform } = process; const menuOptions = { development, + saveDebugLog, showWindow, showAbout, openReleaseNotes, diff --git a/ts/node/menu.ts b/ts/node/menu.ts index 7eb25799d..0c10f36aa 100644 --- a/ts/node/menu.ts +++ b/ts/node/menu.ts @@ -7,6 +7,7 @@ export const createTemplate = ( openSupportPage: () => void; platform: string; showAbout: () => void; + saveDebugLog: (_event: any, additionalInfo?: string) => void; showWindow: () => void; }, messages: LocaleMessagesType @@ -15,7 +16,8 @@ export const createTemplate = ( throw new TypeError('`options.platform` must be a string'); } - const { openReleaseNotes, openSupportPage, platform, showAbout, showWindow } = options; + const { openReleaseNotes, openSupportPage, platform, showAbout, saveDebugLog, showWindow } = + options; const template = [ { @@ -92,6 +94,15 @@ export const createTemplate = ( { type: 'separator', }, + { + label: messages.showDebugLog, + click: () => { + saveDebugLog('save-debug-log'); + }, + }, + { + type: 'separator', + }, { role: 'toggledevtools', label: messages.viewMenuToggleDevTools,