diff options
-rw-r--r-- | src/index.js | 2 | ||||
-rw-r--r-- | src/lib/Tray.js | 7 |
2 files changed, 2 insertions, 7 deletions
diff --git a/src/index.js b/src/index.js index 9ca059f48..030736fee 100644 --- a/src/index.js +++ b/src/index.js | |||
@@ -66,7 +66,7 @@ const createWindow = async () => { | |||
66 | }); | 66 | }); |
67 | 67 | ||
68 | // Initialize System Tray | 68 | // Initialize System Tray |
69 | const trayIcon = new Tray(mainWindow); | 69 | const trayIcon = new Tray(); |
70 | 70 | ||
71 | // Initialize ipcApi | 71 | // Initialize ipcApi |
72 | ipcApi({ mainWindow, settings, trayIcon }); | 72 | ipcApi({ mainWindow, settings, trayIcon }); |
diff --git a/src/lib/Tray.js b/src/lib/Tray.js index 2101d1503..525ce592e 100644 --- a/src/lib/Tray.js +++ b/src/lib/Tray.js | |||
@@ -6,13 +6,8 @@ const INDICATOR_TRAY_PLAIN = 'tray'; | |||
6 | const INDICATOR_TRAY_UNREAD = 'tray-unread'; | 6 | const INDICATOR_TRAY_UNREAD = 'tray-unread'; |
7 | 7 | ||
8 | export default class TrayIcon { | 8 | export default class TrayIcon { |
9 | mainWindow = null; | ||
10 | trayIcon = null; | 9 | trayIcon = null; |
11 | 10 | ||
12 | constructor(mainWindow) { | ||
13 | this.mainWindow = mainWindow; | ||
14 | } | ||
15 | |||
16 | show() { | 11 | show() { |
17 | if (this.trayIcon) return; | 12 | if (this.trayIcon) return; |
18 | 13 | ||
@@ -35,7 +30,7 @@ export default class TrayIcon { | |||
35 | this.trayIcon.setContextMenu(trayMenu); | 30 | this.trayIcon.setContextMenu(trayMenu); |
36 | 31 | ||
37 | this.trayIcon.on('click', () => { | 32 | this.trayIcon.on('click', () => { |
38 | this.mainWindow.show(); | 33 | app.mainWindow.show(); |
39 | }); | 34 | }); |
40 | } | 35 | } |
41 | 36 | ||