Skip to content

Commit 017789e

Browse files
committed
Remove icon when all windows are closed
1 parent a7cfa66 commit 017789e

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

main-process/native-ui/tray/tray.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
const path = require('path')
22
const electron = require('electron')
33
const ipc = electron.ipcMain
4+
const app = electron.app
45

56
let appIcon = null
67

@@ -22,3 +23,7 @@ ipc.on('put-in-tray', function (event) {
2223
ipc.on('remove-tray', function (event) {
2324
appIcon.destroy()
2425
})
26+
27+
app.on('window-all-closed', function (event) {
28+
appIcon.destroy()
29+
})

0 commit comments

Comments
 (0)