diff options
Diffstat (limited to 'ui/index.js')
| -rw-r--r-- | ui/index.js | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/ui/index.js b/ui/index.js new file mode 100644 index 0000000..9751fb2 --- /dev/null +++ b/ui/index.js @@ -0,0 +1,29 @@ +const { app, BrowserWindow, ipcMain } = require('electron'); +const path = require('node:path'); + +function createWindow () { + const mainWindow = new BrowserWindow({ + width: 800, + height: 600, + webPreferences: { + preload: path.join(__dirname, 'preload.js'), + contextIsolation: true, + nodeIntegration: false + } + }); + + mainWindow.loadFile('index.html'); +} + +app.whenReady().then(() => { + createWindow(); + + app.on('activate', function () { + if (BrowserWindow.getAllWindows().length === 0) createWindow(); + }); +}); + +app.on('window-all-closed', function () { + if (process.platform !== 'darwin') app.quit(); +}); + |
