Files
global-navigation-satellite…/src/main/app.ts

35 lines
708 B
TypeScript
Raw Normal View History

2021-09-14 07:31:59 +08:00
import { app, BrowserWindow } from 'electron'
import { join } from "path"
function createWindow() {
2021-12-09 15:06:40 +08:00
const win = new BrowserWindow({
fullscreen: true,
frame: false,
webPreferences: {
nodeIntegration: true,
preload: join(__dirname, 'preload.js')
}
})
2021-09-14 07:31:59 +08:00
2021-12-09 15:06:40 +08:00
if (process.env.NODE_ENV === 'development') {
win.loadURL('http://localhost:3000/')
win.webContents.openDevTools()
} else {
win.loadFile('dist/render/index.html')
}
2021-09-14 07:31:59 +08:00
}
app.whenReady().then(createWindow)
app.on('window-all-closed', () => {
2021-12-09 15:06:40 +08:00
if (process.platform !== 'darwin') {
app.quit()
}
2021-09-14 07:31:59 +08:00
})
app.on('activate', () => {
2021-12-09 15:06:40 +08:00
if (BrowserWindow.getAllWindows().length === 0) {
createWindow()
}
})