diff --git a/electron/main/index.ts b/electron/main/index.ts index bab5a59..be0fcf5 100644 --- a/electron/main/index.ts +++ b/electron/main/index.ts @@ -96,7 +96,7 @@ app.on('activate', () => { } }) -// new window example arg: new windows url +// New window example arg: new windows url ipcMain.handle('open-win', (event, arg) => { const childWindow = new BrowserWindow({ webPreferences: { @@ -106,10 +106,9 @@ ipcMain.handle('open-win', (event, arg) => { }, }) - if (app.isPackaged) { - childWindow.loadFile(indexHtml, { hash: arg }) - } else { + if (process.env.VITE_DEV_SERVER_URL) { childWindow.loadURL(`${url}#${arg}`) - // childWindow.webContents.openDevTools({ mode: "undocked", activate: true }) + } else { + childWindow.loadFile(indexHtml, { hash: arg }) } })