2023-08-28 11:23:10 +00:00
|
|
|
const { app, BrowserWindow } = require('electron/main')
|
2022-06-22 08:17:48 +00:00
|
|
|
|
|
|
|
const createWindow = () => {
|
|
|
|
const win = new BrowserWindow({
|
|
|
|
width: 800,
|
2023-04-05 13:42:20 +00:00
|
|
|
height: 600
|
|
|
|
})
|
2022-06-22 08:17:48 +00:00
|
|
|
|
2023-04-05 13:42:20 +00:00
|
|
|
win.loadFile('index.html')
|
|
|
|
}
|
2022-06-22 08:17:48 +00:00
|
|
|
|
|
|
|
app.whenReady().then(() => {
|
2023-04-05 13:42:20 +00:00
|
|
|
createWindow()
|
2022-06-22 08:17:48 +00:00
|
|
|
|
|
|
|
app.on('activate', () => {
|
|
|
|
if (BrowserWindow.getAllWindows().length === 0) {
|
2023-04-05 13:42:20 +00:00
|
|
|
createWindow()
|
2022-06-22 08:17:48 +00:00
|
|
|
}
|
2023-04-05 13:42:20 +00:00
|
|
|
})
|
|
|
|
})
|
2022-06-22 08:17:48 +00:00
|
|
|
|
|
|
|
app.on('window-all-closed', () => {
|
|
|
|
if (process.platform !== 'darwin') {
|
2023-04-05 13:42:20 +00:00
|
|
|
app.quit()
|
2022-06-22 08:17:48 +00:00
|
|
|
}
|
2023-04-05 13:42:20 +00:00
|
|
|
})
|