#970 skip source reinitialization when relaunching app from launcher

This commit is contained in:
Thibault Deckers 2024-04-09 20:06:08 +02:00
parent 71e9e07668
commit 1b70b389e6
2 changed files with 6 additions and 12 deletions

View file

@ -619,14 +619,6 @@ class _AvesAppState extends State<AvesApp> with WidgetsBindingObserver {
}
void _onNewIntent(Map? intentData) {
debugPrint('$runtimeType onNewIntent with intentData=$intentData');
// do not reset when relaunching the app
if (_appModeNotifier.value == AppMode.main && (intentData == null || intentData.isEmpty == true)) {
reportService.log('Relaunch');
return;
}
reportService.log('New intent data=$intentData');
_navigatorKey.currentState!.pushReplacement(DirectMaterialPageRoute(
settings: const RouteSettings(name: HomePage.routeName),

View file

@ -195,10 +195,12 @@ class _HomePageState extends State<HomePage> {
unawaited(GlobalSearch.registerCallback());
unawaited(AnalysisService.registerCallback());
final source = context.read<CollectionSource>();
if (source.initState != SourceInitializationState.full) {
await source.init(
loadTopEntriesFirst: settings.homePage == HomePageSetting.collection && settings.homeCustomCollection.isEmpty,
canAnalyze: !safeMode,
);
}
case AppMode.screenSaver:
final source = context.read<CollectionSource>();
await source.init(