Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions first-run.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,5 +50,4 @@ function isFirstRun() {
return true;
}

module.exports = { onFirstRunMaybe }

module.exports = { onFirstRunMaybe };
19 changes: 17 additions & 2 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand All @@ -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,
Expand All @@ -32,6 +45,8 @@ const menubarApp = menubar({
});

menubarApp.on('ready', () => {
delayedHideAppIcon();

menubarApp.tray.setIgnoreDoubleClickEvents(true);

autoUpdater.checkForUpdatesAndNotify();
Expand Down