import { app , Menu } from "electron" ; import contextMenu from "electron-context-menu" ; import "./bootstrap" ; import { createAppMenu } from "./menu" ; import { createMainWindow , getOpenWindows , trackWindow } from "./window" ; import "./ipc/index" ; import "./ipc/updater" ; if ( require ( "electron-squirrel-startup" ) ) { app . quit ( ) ; } require ( "electron-debug" ) ( { isEnabled : true , showDevTools : false } ) ; contextMenu ( ) ; const appReady = new Promise ( resolve => app . on ( "ready" , resolve ) ) ; app . on ( "ready" , ( ) => { const menu = createAppMenu ( ) ; if ( menu ) { Menu . setApplicationMenu ( menu ) ; } trackWindow ( createMainWindow ( ) ) ; } ) ; app . on ( "window-all-closed" , ( ) => { if ( process . platform !== "darwin" ) { app . quit ( ) ; } } ) ; app . on ( "activate" , ( ) => { if ( getOpenWindows ( ) . length === 0 ) { appReady . then ( ( ) => { trackWindow ( createMainWindow ( ) ) ; } ) ; } } ) ;