Skip to content

Commit

Permalink
Fix multiple event creation
Browse files Browse the repository at this point in the history
  • Loading branch information
hovancik committed Aug 3, 2023
1 parent 4484843 commit f964531
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions app/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -1150,14 +1156,6 @@ function updateTray () {
appIcon.setContextMenu(trayMenu)
currentTrayMenuTemplate = newTrayMenuTemplate
}

appIcon.on('double-click', () => {
createPreferencesWindow()
})

appIcon.on('click', () => {
appIcon.popUpContextMenu(Menu.buildFromTemplate(currentTrayMenuTemplate))
})
}
}

Expand Down

0 comments on commit f964531

Please sign in to comment.