diff --git a/main.js b/main.js index f148030..180a862 100644 --- a/main.js +++ b/main.js @@ -39,11 +39,18 @@ ipc.on('log-out',function(){ win.webContents.session.clearStorageData({storages: "cookies"});win.loadURL("http://pf.gree.net/58737",options); }); -// Quit when all windows are closed. -app.on('window-all-closed', () => { - // On macOS it is common for applications and their menu bar +app.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') { + if (process.platform !== 'darwin') { app.quit() - //} + } +}) + +app.on('activate', function () { + // On OS X it's common to re-create a window in the app when the + // dock icon is clicked and there are no other windows open. + if (mainWindow === null) { + createWindow() + } })