From 6cd5d819ea76b216c15e5c068448c2971ee3729a Mon Sep 17 00:00:00 2001 From: Austin Warren Date: Thu, 18 Jul 2019 10:48:11 -0700 Subject: [PATCH] Added setTimeout to make sure that tray operation is complete before we destroy tray icon --- app/lib/app.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/app/lib/app.ts b/app/lib/app.ts index b67cce41..334a308b 100644 --- a/app/lib/app.ts +++ b/app/lib/app.ts @@ -72,7 +72,7 @@ export class Application { this.tray = new Tray(`${app.getAppPath()}/assets/tray.png`) } - this.tray.on('click', () => this.focus()) + this.tray.on('click', () => setTimeout(() => this.focus())); const contextMenu = Menu.buildFromTemplate([{ label: 'Show', @@ -100,7 +100,6 @@ export class Application { focus () { for (let window of this.windows) { window.show() - window.focus() } }