aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatar Stefan Malzner <stefan@adlk.io>2017-10-27 11:52:18 +0200
committerLibravatar GitHub <noreply@github.com>2017-10-27 11:52:18 +0200
commit78bff72bfc8ea5b43adbdfa9981088e6bd13c7da (patch)
tree46920f7c175b5ef5af79a95b155ccfed27e86fb2
parentMerge branch 'develop' into patch-1 (diff)
parentMerge pull request #134 from atakangktepe/fix_tray (diff)
downloadferdium-app-78bff72bfc8ea5b43adbdfa9981088e6bd13c7da.tar.gz
ferdium-app-78bff72bfc8ea5b43adbdfa9981088e6bd13c7da.tar.zst
ferdium-app-78bff72bfc8ea5b43adbdfa9981088e6bd13c7da.zip
Merge branch 'develop' into patch-1
-rw-r--r--src/index.js2
-rw-r--r--src/lib/Tray.js9
2 files changed, 3 insertions, 8 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 67150971e..525ce592e 100644
--- a/src/lib/Tray.js
+++ b/src/lib/Tray.js
@@ -6,13 +6,8 @@ const INDICATOR_TRAY_PLAIN = 'tray';
6const INDICATOR_TRAY_UNREAD = 'tray-unread'; 6const INDICATOR_TRAY_UNREAD = 'tray-unread';
7 7
8export default class TrayIcon { 8export 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
@@ -21,7 +16,7 @@ export default class TrayIcon {
21 { 16 {
22 label: 'Show Franz', 17 label: 'Show Franz',
23 click() { 18 click() {
24 this.mainWindow.show(); 19 app.mainWindow.show();
25 }, 20 },
26 }, { 21 }, {
27 label: 'Quit Franz', 22 label: 'Quit Franz',
@@ -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