From a13c0e0be5e87e145010f6d65ee94864f382b4ab Mon Sep 17 00:00:00 2001 From: David Baker Date: Tue, 10 Dec 2019 18:02:20 +0000 Subject: [PATCH] Electron API updates A couple of changes to properties rather than functions and the register*Protocol functionsd are now synchronous and so don't need a completion callback. --- src/electron-main.js | 4 +--- src/vectormenu.js | 5 ++--- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/src/electron-main.js b/src/electron-main.js index 517777b..1bf4ebe 100644 --- a/src/electron-main.js +++ b/src/electron-main.js @@ -180,7 +180,7 @@ process.on('uncaughtException', function(error) { let focusHandlerAttached = false; ipcMain.on('setBadgeCount', function(ev, count) { - app.setBadgeCount(count); + app.badgeCount = count; if (count === 0 && mainWindow) { mainWindow.flashFrame(false); } @@ -543,8 +543,6 @@ app.on('ready', async () => { callback({ path: absTarget, }); - }, (error) => { - if (error) console.error('Failed to register protocol'); }); if (argv['no-update']) { diff --git a/src/vectormenu.js b/src/vectormenu.js index a8f998b..3d52527 100644 --- a/src/vectormenu.js +++ b/src/vectormenu.js @@ -66,10 +66,9 @@ const template = [ // macOS has specific menu conventions... if (process.platform === 'darwin') { - // first macOS menu is the name of the app - const name = app.getName(); template.unshift({ - label: name, + // first macOS menu is the name of the app + label: app.name, submenu: [ { role: 'about' }, { type: 'separator' },