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
2023-12-19 09:22:43 +00:00
parent e10609276d
commit 128f8066c3
8 changed files with 40 additions and 37 deletions

View File

@@ -16,19 +16,25 @@ const performanceMainLogger = performanceLogger.namespace('main');
function main() {
performanceMainLogger.info('start');
const rootStore = getCurrentStore();
performanceMainLogger.info('setup start');
setup();
performanceMainLogger.info('setup done');
// skip bootstrap setup for desktop onboarding
if (window.appInfo?.windowName !== 'onboarding') {
const rootStore = getCurrentStore();
performanceMainLogger.info('setup start');
setup();
performanceMainLogger.info('setup done');
bootstrapPluginSystem(rootStore).catch(err => {
console.error('Failed to bootstrap plugin system', err);
});
bootstrapPluginSystem(rootStore).catch(err => {
console.error('Failed to bootstrap plugin system', err);
});
}
mountApp();
}
function mountApp() {
performanceMainLogger.info('import app');
const root = document.getElementById('app');
assertExists(root);
performanceMainLogger.info('render app');
createRoot(root).render(
<StrictMode>