mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-08-24 05:07:06 +08:00
@@ -1,24 +1,11 @@
|
|||||||
import { logger } from '../logger';
|
import { logger } from '../logger';
|
||||||
import { initAndShowMainWindow } from './main-window';
|
import { initAndShowMainWindow } from './main-window';
|
||||||
import { getOnboardingWindow, getOrCreateOnboardingWindow } from './onboarding';
|
|
||||||
import { launchStage } from './stage';
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Launch app depending on launch stage
|
* Launch app depending on launch stage
|
||||||
*/
|
*/
|
||||||
export async function launch() {
|
export async function launch() {
|
||||||
const stage = launchStage.value;
|
initAndShowMainWindow().catch(e => {
|
||||||
if (stage === 'main') {
|
logger.error('Failed to restore or create window:', e);
|
||||||
initAndShowMainWindow().catch(e => {
|
});
|
||||||
logger.error('Failed to restore or create window:', e);
|
|
||||||
});
|
|
||||||
|
|
||||||
getOnboardingWindow()
|
|
||||||
.then(w => w?.destroy())
|
|
||||||
.catch(e => logger.error('Failed to destroy onboarding window:', e));
|
|
||||||
}
|
|
||||||
if (stage === 'onboarding')
|
|
||||||
getOrCreateOnboardingWindow().catch(e => {
|
|
||||||
logger.error('Failed to restore or create onboarding window:', e);
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user