Skip to content

Commit

Permalink
Refactor initialization sequence for clarity
Browse files Browse the repository at this point in the history
Move the IPC Communication initialization block before the condition checking the development environment. This change ensures that IPCs are initialized before the main window starts loading its content, which may be crucial for ensuring that all IPC handlers are set up properly regardless of the environment.
  • Loading branch information
choigawoon committed Nov 8, 2023
1 parent 105077f commit 7015667
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/main/MainRunner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,15 @@ export const createMainWindow = async (mainWindow: BrowserWindow): Promise<Brows
mainWindow.setAlwaysOnTop(false)
})

// Initialize IPC Communication
IPCs.initialize(mainWindow)

if (Constants.IS_DEV_ENV) {
await mainWindow.loadURL(Constants.APP_INDEX_URL_DEV)
} else {
await mainWindow.loadFile(Constants.APP_INDEX_URL_PROD)
}

// Initialize IPC Communication
IPCs.initialize(mainWindow)

return mainWindow
}

Expand Down

0 comments on commit 7015667

Please sign in to comment.