2023-09-05 13:30:02 +00:00
|
|
|
"use strict";const o=require("electron"),n=require("node:path");process.env.ELECTRON_DISABLE_SECURITY_WARNINGS="true";process.env.DIST=n.join(__dirname,"../dist");process.env.PUBLIC=o.app.isPackaged?process.env.DIST:n.join(process.env.DIST,"../public");let e;const s=process.env.VITE_DEV_SERVER_URL;function a(){e=new o.BrowserWindow({icon:n.join(process.env.PUBLIC,"electron-vite.svg"),webPreferences:{preload:n.join(__dirname,"preload.js"),backgroundThrottle:!1,nodeIntegration:!0,contextIsolation:!1,enableRemoteModule:!1,sandbox:!1}}),e.webContents.on("did-finish-load",()=>{e==null||e.webContents.send("main-process-message",new Date().toLocaleString())}),s?e.loadURL(s):e.loadFile(n.join(process.env.DIST,"index.html"))}o.app.on("window-all-closed",()=>{e=null});o.app.whenReady().then(a);o.ipcMain.on("request-update-daemon-state",(r,t)=>{e.webContents.send("action-update-daemon-state",t)});
|