mirror of https://github.com/Kylart/KawAnime.git
Fix Tray for other platform than Mac
This commit is contained in:
parent
0c11428ce5
commit
99cec1316a
16
main.js
16
main.js
|
@ -200,6 +200,9 @@ const newWin = () => {
|
|||
}))
|
||||
}
|
||||
|
||||
process.win = win
|
||||
process.appURL = _APP_URL_
|
||||
|
||||
pollServer()
|
||||
}
|
||||
|
||||
|
@ -207,7 +210,9 @@ Electron.on('ready', () => {
|
|||
Menu.setApplicationMenu(menu)
|
||||
|
||||
if (localConfig.system.toTray) {
|
||||
Electron.dock.hide()
|
||||
if (process.platform === 'darwin') {
|
||||
Electron.dock.hide()
|
||||
}
|
||||
tray = new Tray(path.join(__dirname, 'static', 'images', 'tray.png'))
|
||||
const contextMenu = Menu.buildFromTemplate([
|
||||
{label: 'New window', click: () => { win === null && newWin() }, accelerator: 'CommandOrControl+N'},
|
||||
|
@ -220,9 +225,6 @@ Electron.on('ready', () => {
|
|||
}
|
||||
|
||||
newWin()
|
||||
|
||||
process.win = win
|
||||
process.appURL = _APP_URL_
|
||||
})
|
||||
|
||||
// Quit when all windows are closed.
|
||||
|
@ -230,8 +232,10 @@ Electron.on('window-all-closed', function () {
|
|||
// On OS X it is common for applications and their menu bar
|
||||
// to stay active until the user quits explicitly with Cmd + Q
|
||||
if (process.platform !== 'darwin') {
|
||||
server.close()
|
||||
Electron.quit()
|
||||
if (!tray) {
|
||||
server.close()
|
||||
Electron.quit()
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
|
|
Loading…
Reference in New Issue