Skip to content

Commit

Permalink
refactor: clean up commented code and streamline window loading logic
Browse files Browse the repository at this point in the history
  • Loading branch information
sajjadmrx committed Nov 8, 2024
1 parent 1ebad01 commit 7579f16
Showing 1 changed file with 2 additions and 14 deletions.
16 changes: 2 additions & 14 deletions src/main/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,18 +83,10 @@ async function createWindow() {
if (os.platform() === 'darwin') win.setWindowButtonVisibility(false)

win.setMenu(null)
await serve(win)

// await win.loadURL(startUrl)

// if (url) {
// await win.loadURL(url)
// } else {
// await win.loadFile(indexHtml)
// }
// if (isDev) win.webContents.openDevTools()
await serve(win)

win.webContents.openDevTools()
if (isDev) win.webContents.openDevTools()

win.webContents.on('did-finish-load', () => {
win?.webContents.send('main-process-message', new Date().toLocaleString())
Expand Down Expand Up @@ -156,11 +148,7 @@ ipcMain.handle('open-win', (_, arg) => {
},
})

// if (process.env.VITE_DEV_SERVER_URL) {
childWindow.loadURL(`${startUrl}#${arg}`)
// } else {
// childWindow.loadFile(indexHtml, { hash: arg })
// }
})

import './ipc/setting'
Expand Down

0 comments on commit 7579f16

Please sign in to comment.