aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/Tray.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/Tray.js')
-rw-r--r--src/lib/Tray.js9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/lib/Tray.js b/src/lib/Tray.js
index e7afc3552..eb6732c30 100644
--- a/src/lib/Tray.js
+++ b/src/lib/Tray.js
@@ -32,6 +32,9 @@ export default class TrayIcon {
32 { 32 {
33 label: 'Show Ferdi', 33 label: 'Show Ferdi',
34 click() { 34 click() {
35 if (!app.mainWindow) {
36 return;
37 }
35 if (app.mainWindow.isMinimized()) { 38 if (app.mainWindow.isMinimized()) {
36 app.mainWindow.restore(); 39 app.mainWindow.restore();
37 } else if (app.mainWindow.isVisible()) { 40 } else if (app.mainWindow.isVisible()) {
@@ -45,6 +48,9 @@ export default class TrayIcon {
45 { 48 {
46 label: 'Disable Notifications & Audio', 49 label: 'Disable Notifications & Audio',
47 click() { 50 click() {
51 if (!app.mainWindow) {
52 return;
53 }
48 app.mainWindow.webContents.send('muteApp'); 54 app.mainWindow.webContents.send('muteApp');
49 }, 55 },
50 }, 56 },
@@ -99,6 +105,9 @@ export default class TrayIcon {
99 } 105 }
100 106
101 this.trayIcon.on('click', () => { 107 this.trayIcon.on('click', () => {
108 if (!app.mainWindow) {
109 return;
110 }
102 if (app.mainWindow.isMinimized()) { 111 if (app.mainWindow.isMinimized()) {
103 app.mainWindow.restore(); 112 app.mainWindow.restore();
104 } else if (app.mainWindow.isVisible()) { 113 } else if (app.mainWindow.isVisible()) {