diff --git a/first-run.js b/first-run.js index 249171211..00e32dc65 100644 --- a/first-run.js +++ b/first-run.js @@ -50,5 +50,4 @@ function isFirstRun() { return true; } -module.exports = { onFirstRunMaybe } - +module.exports = { onFirstRunMaybe }; diff --git a/main.js b/main.js index 5002f9918..f6ad081f1 100644 --- a/main.js +++ b/main.js @@ -4,7 +4,12 @@ const { autoUpdater } = require('electron-updater'); const { onFirstRunMaybe } = require('./first-run'); const path = require('path'); -const iconIdle = path.join(__dirname, 'assets', 'images', 'tray-idleTemplate.png'); +const iconIdle = path.join( + __dirname, + 'assets', + 'images', + 'tray-idleTemplate.png' +); const iconActive = path.join(__dirname, 'assets', 'images', 'tray-active.png'); const browserWindowOpts = { @@ -17,12 +22,20 @@ const browserWindowOpts = { enableRemoteModule: true, overlayScrollbars: true, nodeIntegration: true, + contextIsolation: false, }, }; +const delayedHideAppIcon = () => + // Setting a timeout because the showDockIcon is not currently working + // See more at https://github.com/maxogden/menubar/issues/306 + setTimeout(() => { + app.dock.hide(); + }, 1500); + app.on('ready', async () => { await onFirstRunMaybe(); -}) +}); const menubarApp = menubar({ icon: iconIdle, @@ -32,6 +45,8 @@ const menubarApp = menubar({ }); menubarApp.on('ready', () => { + delayedHideAppIcon(); + menubarApp.tray.setIgnoreDoubleClickEvents(true); autoUpdater.checkForUpdatesAndNotify();