pack: vutron now uses typescript
This commit is contained in:
1 parent
30b0676f13
commit
5a4fa9a981
25 files changed
+580
-26
No files matched your search
@@ -0,0 +1,36 @@
|
||||
import { app, WebContents, RenderProcessGoneDetails } from 'electron'
|
||||
import Constants from './utils/Constants'
|
||||
import { createErrorWindow, createMainWindow } from './MainRunner'
|
||||
import Menus from './utils/Menus'
|
||||
|
||||
let mainWindow
|
||||
let errorWindow
|
||||
|
||||
app.on('ready', () => {
|
||||
Menus.macOSDisableDefaultMenuItem()
|
||||
|
||||
mainWindow = createMainWindow(mainWindow)
|
||||
})
|
||||
|
||||
app.on('activate', () => {
|
||||
if (!mainWindow) {
|
||||
mainWindow = createMainWindow(mainWindow)
|
||||
}
|
||||
})
|
||||
|
||||
app.on('window-all-closed', () => {
|
||||
mainWindow = null
|
||||
errorWindow = null
|
||||
|
||||
if (!Constants.IS_MAC) {
|
||||
app.quit()
|
||||
}
|
||||
})
|
||||
|
||||
app.on('render-process-gone', (event: Event, webContents: WebContents, details: RenderProcessGoneDetails) => {
|
||||
errorWindow = createErrorWindow(errorWindow, mainWindow, details)
|
||||
})
|
||||
|
||||
process.on('uncaughtException', () => {
|
||||
errorWindow = createErrorWindow(errorWindow, mainWindow)
|
||||
})
|
||||
Reference in new issue
Block a user