From 6a53c26cc5e68d1bbaa26221c1dadadb69ab1b2b Mon Sep 17 00:00:00 2001 From: Damillora Date: Tue, 4 Jul 2017 00:02:52 +0700 Subject: [PATCH] darwin lol --- main.js | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) 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() + } })