Skip to content

Commit

Permalink
Destroy existing trayIcon when creating new one
Browse files Browse the repository at this point in the history
  • Loading branch information
oliverschwendener committed Jul 19, 2018
1 parent eb66402 commit 37d7e1e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/ts/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,10 @@ function createMainWindow(): void {
}

function createTrayIcon(): void {
if (trayIcon !== undefined && !trayIcon.isDestroyed()) {
trayIcon.destroy();
}

trayIcon = new Tray(Injector.getTrayIconPath(platform(), path.join(__dirname, "../")));
trayIcon.setToolTip(UeliHelpers.productName);
trayIcon.setContextMenu(Menu.buildFromTemplate([
Expand Down

0 comments on commit 37d7e1e

Please sign in to comment.