From f964531ffb62671697f954b2bcf75384f97046f0 Mon Sep 17 00:00:00 2001 From: Jan Hovancik Date: Thu, 3 Aug 2023 19:34:39 +0200 Subject: [PATCH] Fix multiple event creation --- app/main.js | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/app/main.js b/app/main.js index 4091ea315..50663ee02 100644 --- a/app/main.js +++ b/app/main.js @@ -1131,6 +1131,12 @@ function updateTray () { if (settings.get('showTrayIcon')) { if (!appIcon) { appIcon = new Tray(trayIconPath()) + appIcon.on('double-click', () => { + createPreferencesWindow() + }) + appIcon.on('click', () => { + appIcon.popUpContextMenu(Menu.buildFromTemplate(currentTrayMenuTemplate)) + }) } if (!trayUpdateIntervalObj) { trayUpdateIntervalObj = setInterval(updateTray, 10000) @@ -1150,14 +1156,6 @@ function updateTray () { appIcon.setContextMenu(trayMenu) currentTrayMenuTemplate = newTrayMenuTemplate } - - appIcon.on('double-click', () => { - createPreferencesWindow() - }) - - appIcon.on('click', () => { - appIcon.popUpContextMenu(Menu.buildFromTemplate(currentTrayMenuTemplate)) - }) } }