Optimize initialization

This commit is contained in:
LittleSheep 2025-03-30 20:43:47 +08:00
parent 51a387851f
commit 4bd8ec54f1

@ -467,15 +467,22 @@ class _AppSplashScreenState extends State<_AppSplashScreen> with TrayListener {
AppLifecycleListener(onExitRequested: _onExitRequested);
}
_trayInitialization();
_hotkeyInitialization();
_notifyInitialization();
_initialize().then((_) {
_postInitialization();
_tryRequestRating();
_checkForUpdate();
setState(() => _isBusy = false);
});
try {
_trayInitialization();
_hotkeyInitialization();
_notifyInitialization();
_initialize().then((_) {
_postInitialization();
_tryRequestRating();
_checkForUpdate();
setState(() => _isBusy = false);
}).catchError((err) {
logging.error('[Bootstrap] Unable to initialize app', err);
setState(() => _isBusy = false);
});
} catch (err) {
logging.error('[Bootstrap] Unable to initialize (pre-stage) app', err);
}
}
Future<AppExitResponse> _onExitRequested() async {