fix: restore export logs menu item

pull/3173/head
yougotwill 9 months ago
parent e83c047053
commit 7f97d3c6cb

@ -649,7 +649,7 @@ async function showAbout() {
aboutWindow?.show(); aboutWindow?.show();
} }
async function saveDebugLog(_event: any, additionalInfo: string) { async function saveDebugLog(_event: any, additionalInfo?: string) {
const options: Electron.SaveDialogOptions = { const options: Electron.SaveDialogOptions = {
title: 'Save debug log', title: 'Save debug log',
defaultPath: path.join( defaultPath: path.join(
@ -799,6 +799,7 @@ function setupMenu() {
const { platform } = process; const { platform } = process;
const menuOptions = { const menuOptions = {
development, development,
saveDebugLog,
showWindow, showWindow,
showAbout, showAbout,
openReleaseNotes, openReleaseNotes,

@ -7,6 +7,7 @@ export const createTemplate = (
openSupportPage: () => void; openSupportPage: () => void;
platform: string; platform: string;
showAbout: () => void; showAbout: () => void;
saveDebugLog: (_event: any, additionalInfo?: string) => void;
showWindow: () => void; showWindow: () => void;
}, },
messages: LocaleMessagesType messages: LocaleMessagesType
@ -15,7 +16,8 @@ export const createTemplate = (
throw new TypeError('`options.platform` must be a string'); 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 = [ const template = [
{ {
@ -92,6 +94,15 @@ export const createTemplate = (
{ {
type: 'separator', type: 'separator',
}, },
{
label: messages.showDebugLog,
click: () => {
saveDebugLog('save-debug-log');
},
},
{
type: 'separator',
},
{ {
role: 'toggledevtools', role: 'toggledevtools',
label: messages.viewMenuToggleDevTools, label: messages.viewMenuToggleDevTools,

Loading…
Cancel
Save