fix(electron): main window should be opened first before destroying onboard window (#5319)

The issue listed on the title will prevent main window from showing on windows.
This commit is contained in:
Peng Xiao committed 2023-12-19 09:22:44 +00:00
1 parent e10609276d
commit 128f8066c3
8 files changed
+40 -37

No files matched your search

@@ -54,10 +54,17 @@ export const uiHandlers = {
launchStage.value = 'main';
persistentConfig.patch('onBoarding', false);
}
initMainWindow().catch(logger.error);
getOnboardingWindow()
.then(w => w?.destroy())
.catch(logger.error);
try {
const onboarding = await getOnboardingWindow();
onboarding?.hide();
await initMainWindow();
// need to destroy onboarding window after main window is ready
// otherwise the main window will be closed as well
onboarding?.destroy();
} catch (err) {
logger.error('handleOpenMainApp', err);
}
},
getBookmarkDataByLink: async (_, link: string) => {
if (