app.on('activate', function() { if (mainWindow === null) { createWindow(); } });
function setBadgeCount(count) { if (process.platform === 'darwin') { remote.app.setBadgeCount(count); } }
ipcMain.on('application:dock-message-notification', function(event, id) { dockNotificationCache[id] = dockNotificationCache[id] + 1; if (process.platform === 'darwin' || (process.platform === 'linux' && app.isUnityRunning && app.isUnityRunning())) { app.setBadgeCount(dockNotificationCache[id]); } if (process.platform === 'darwin') { app.dock.bounce(); } });
// Install `vue-devtools` require('electron').app.on('ready', () => { let installExtension = require('electron-devtools-installer') installExtension.default(installExtension.VUEJS_DEVTOOLS) .then(() => {}) .catch(err => { console.log('Unable to install `vue-devtools`: \n', err) }) })
app.on('window-all-closed', () => { db.set("auto_page", "0"); db.set("is_mouse", "0"); if (isMac) { db.set("curr_model", "1") } if (process.platform !== 'darwin') { app.quit() } })
app.on('browser-window-focus', (event, window) => { window.$focus = true; dockNotificationCache[window.id] = 0; if (process.platform === 'darwin' || (process.platform === 'linux' && app.isUnityRunning && app.isUnityRunning())) { app.setBadgeCount(0); } });
app.on('activate', () => { // 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) mainWindow.show(); if (win === null && mainWindow === null) { createWindow(); } });
/* ======================= APP EVENTS ======================= */ app.on('ready', () => { createWindow(); setupListeners(); createMenu(); });
app.on('activate', (event, hasVisibleWindows) => { if(!hasVisibleWindows && appReady) { onReady(); } });
app.on('activate', function() { if (mainWindow === null) { createWindow(); } });
app.on("activate", () => { // On macOS 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 (win === null) { createWindow(); } });