Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: remove delayedHideAppIcon() #810

Merged
merged 1 commit into from
Feb 22, 2024
Merged
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
19 changes: 4 additions & 15 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ const { autoUpdater } = require('electron-updater');
const { onFirstRunMaybe } = require('./first-run');
const path = require('path');

require('@electron/remote/main').initialize()
require('@electron/remote/main').initialize();

app.setAppUserModelId('com.electron.gitify');

const iconIdle = path.join(
__dirname,
'assets',
'images',
'tray-idleTemplate.png'
'tray-idleTemplate.png',
);
const iconActive = path.join(__dirname, 'assets', 'images', 'tray-active.png');

Expand All @@ -30,16 +30,6 @@ const browserWindowOpts = {
},
};

const delayedHideAppIcon = () => {
if (app.dock && app.dock.hide) {
// 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();
});
Expand All @@ -49,11 +39,10 @@ const menubarApp = menubar({
index: `file://${__dirname}/index.html`,
browserWindow: browserWindowOpts,
preloadWindow: true,
showDockIcon: false,
});

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

menubarApp.tray.setIgnoreDoubleClickEvents(true);

autoUpdater.checkForUpdatesAndNotify();
Expand Down Expand Up @@ -100,7 +89,7 @@ menubarApp.on('ready', () => {
const trayBounds = menubarApp.tray.getBounds();
menubarApp.window.setSize(
browserWindowOpts.width,
browserWindowOpts.height
browserWindowOpts.height,
);
menubarApp.positioner.move('trayCenter', trayBounds);
menubarApp.window.resizable = false;
Expand Down