mirror of
https://github.com/bitsocialnet/5chan.git
synced 2026-08-03 07:41:04 +02:00
fix electron reference error
This commit is contained in:
+16
-16
@@ -227,6 +227,22 @@ const createMainWindow = () => {
|
||||
}
|
||||
}
|
||||
|
||||
const appMenuBack = new MenuItem({
|
||||
label: '←',
|
||||
enabled: mainWindow?.webContents?.canGoBack(),
|
||||
click: () => mainWindow?.webContents?.goBack(),
|
||||
});
|
||||
const appMenuForward = new MenuItem({
|
||||
label: '→',
|
||||
enabled: mainWindow?.webContents?.canGoForward(),
|
||||
click: () => mainWindow?.webContents?.goForward(),
|
||||
});
|
||||
const appMenuReload = new MenuItem({
|
||||
label: '⟳',
|
||||
role: 'reload',
|
||||
click: () => mainWindow?.webContents?.reload(),
|
||||
});
|
||||
|
||||
// application menu
|
||||
// hide useless electron help menu
|
||||
if (process.platform === 'darwin') {
|
||||
@@ -243,22 +259,6 @@ const createMainWindow = () => {
|
||||
const appMenu = [appMenuBack, appMenuForward, appMenuReload, ...originalAppMenuWithoutHelp];
|
||||
Menu.setApplicationMenu(Menu.buildFromTemplate(appMenu));
|
||||
}
|
||||
|
||||
const appMenuBack = new MenuItem({
|
||||
label: '←',
|
||||
enabled: mainWindow?.webContents?.canGoBack(),
|
||||
click: () => mainWindow?.webContents?.goBack(),
|
||||
});
|
||||
const appMenuForward = new MenuItem({
|
||||
label: '→',
|
||||
enabled: mainWindow?.webContents?.canGoForward(),
|
||||
click: () => mainWindow?.webContents?.goForward(),
|
||||
});
|
||||
const appMenuReload = new MenuItem({
|
||||
label: '⟳',
|
||||
role: 'reload',
|
||||
click: () => mainWindow?.webContents?.reload(),
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user