mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-12 04:18:54 +00:00
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:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user