Refactor initialization sequence for clarity
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.
This commit is contained in:
1 parent
105077f068
commit
7015667fd6
1 file changed
+3
-3
@@ -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
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user