Fix electron downgrade
This commit is contained in:
@@ -74,7 +74,7 @@ const editMenu: MenuItemConstructorOptions = {
|
||||
],
|
||||
}
|
||||
|
||||
const viewMenu = {
|
||||
const viewMenu: MenuItemConstructorOptions = {
|
||||
label: 'View',
|
||||
submenu: [
|
||||
{
|
||||
@@ -93,8 +93,9 @@ const viewMenu = {
|
||||
click: () => {
|
||||
const window = BrowserWindow.getFocusedWindow()
|
||||
if (window) {
|
||||
const zoom = window.webContents.getZoomFactor()
|
||||
window.webContents.setZoomFactor(Math.min(zoom + 0.1, 2.0))
|
||||
window.webContents.getZoomFactor((zoom) => {
|
||||
window.webContents.setZoomFactor(Math.min(zoom + 0.1, 2.0))
|
||||
})
|
||||
}
|
||||
},
|
||||
},
|
||||
@@ -104,15 +105,16 @@ const viewMenu = {
|
||||
click: () => {
|
||||
const window = BrowserWindow.getFocusedWindow()
|
||||
if (window) {
|
||||
const zoom = window.webContents.getZoomFactor()
|
||||
window.webContents.setZoomFactor(Math.max(zoom - 0.1, 0.5))
|
||||
window.webContents.getZoomFactor((zoom) => {
|
||||
window.webContents.setZoomFactor(Math.max(zoom - 0.1, 0.5))
|
||||
})
|
||||
}
|
||||
},
|
||||
},
|
||||
],
|
||||
}
|
||||
|
||||
const template: Array<(MenuItemConstructorOptions) | (MenuItem)> = [
|
||||
const template: any = [
|
||||
applicationMenu,
|
||||
editMenu,
|
||||
viewMenu,
|
||||
|
||||
Reference in New Issue
Block a user