chore: VITE_DEV_SERVER_URL instead app.isPackaged

This commit is contained in:
草鞋没号 2022-11-22 08:14:27 +08:00
parent f55466cdad
commit c43f6484b9

View File

@ -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 })
}
})