Skip to content

Commit

Permalink
fix: Displaying warning every time the window is minimized to tray (#…
Browse files Browse the repository at this point in the history
…1852)

* Short Term: comment out displaying warning everytime the window is minimized to tray.

The actual fix would be to add a setting to only display this warning
once or never, but for a short term fix this solves the annoying
problem of having a bubble everytime the window is minimized to tray.

* Use a flag to show "still running" balloon once at runtime

Co-authored-by: Tasso Evangelista <[email protected]>
  • Loading branch information
DhruvParanjape and tassoevan authored Oct 27, 2020
1 parent 52ca145 commit 769a210
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/ui/main/trayIcon.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,8 @@ const manageTrayIcon = async (): Promise<() => void> => {
updateTrayIconToolTip(trayIcon, globalBadge);
});

let firstTrayIconBalloonShown = false;

const unwatchIsRootWindowVisible = watch(selectIsRootWindowVisible, (isRootWindowVisible, prevIsRootWindowVisible) => {
const menuTemplate = [
{
Expand Down Expand Up @@ -119,8 +121,9 @@ const manageTrayIcon = async (): Promise<() => void> => {
const menu = Menu.buildFromTemplate(menuTemplate);
trayIcon.setContextMenu(menu);

if (prevIsRootWindowVisible && !isRootWindowVisible && process.platform === 'win32') {
if (prevIsRootWindowVisible && !isRootWindowVisible && process.platform === 'win32' && !firstTrayIconBalloonShown) {
warnStillRunning(trayIcon);
firstTrayIconBalloonShown = true;
}
});

Expand Down

0 comments on commit 769a210

Please sign in to comment.