修复启用托盘后无法退出程序的问题

This commit is contained in:
lyswhut
2020-04-03 21:30:48 +08:00
parent 2e84788d53
commit be84bd27d3
3 changed files with 16 additions and 4 deletions
+3 -1
View File
@@ -1,6 +1,8 @@
global.isQuitting = false
module.exports = mainWindow => {
mainWindow.on('close', event => {
if (global.appSetting.tray.isToTray) {
if (!global.isQuitting && global.appSetting.tray.isToTray) {
event.preventDefault()
mainWindow.hide()
return