| 1 | import { app } from 'electron' |
| 2 | import { MainApplication } from './app/application' |
| 3 | |
| 4 | const mainApplication = new MainApplication() |
| 5 | const gotSingleInstanceLock = app.requestSingleInstanceLock() |
| 6 | |
| 7 | if (!gotSingleInstanceLock) { |
| 8 | app.quit() |
| 9 | } else { |
| 10 | app.on('second-instance', () => mainApplication.focusMainWindow()) |
| 11 | app.whenReady().then(() => mainApplication.start()) |
| 12 | } |
| 13 | |
| 14 | app.on('window-all-closed', () => mainApplication.handleWindowAllClosed()) |
| 15 | app.on('before-quit', () => mainApplication.handleBeforeQuit()) |
| 16 |