#970 skip source reinitialization when relaunching app from launcher
This commit is contained in:
parent
71e9e07668
commit
1b70b389e6
2 changed files with 6 additions and 12 deletions
|
@ -619,14 +619,6 @@ class _AvesAppState extends State<AvesApp> with WidgetsBindingObserver {
|
||||||
}
|
}
|
||||||
|
|
||||||
void _onNewIntent(Map? intentData) {
|
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');
|
reportService.log('New intent data=$intentData');
|
||||||
_navigatorKey.currentState!.pushReplacement(DirectMaterialPageRoute(
|
_navigatorKey.currentState!.pushReplacement(DirectMaterialPageRoute(
|
||||||
settings: const RouteSettings(name: HomePage.routeName),
|
settings: const RouteSettings(name: HomePage.routeName),
|
||||||
|
|
|
@ -195,10 +195,12 @@ class _HomePageState extends State<HomePage> {
|
||||||
unawaited(GlobalSearch.registerCallback());
|
unawaited(GlobalSearch.registerCallback());
|
||||||
unawaited(AnalysisService.registerCallback());
|
unawaited(AnalysisService.registerCallback());
|
||||||
final source = context.read<CollectionSource>();
|
final source = context.read<CollectionSource>();
|
||||||
|
if (source.initState != SourceInitializationState.full) {
|
||||||
await source.init(
|
await source.init(
|
||||||
loadTopEntriesFirst: settings.homePage == HomePageSetting.collection && settings.homeCustomCollection.isEmpty,
|
loadTopEntriesFirst: settings.homePage == HomePageSetting.collection && settings.homeCustomCollection.isEmpty,
|
||||||
canAnalyze: !safeMode,
|
canAnalyze: !safeMode,
|
||||||
);
|
);
|
||||||
|
}
|
||||||
case AppMode.screenSaver:
|
case AppMode.screenSaver:
|
||||||
final source = context.read<CollectionSource>();
|
final source = context.read<CollectionSource>();
|
||||||
await source.init(
|
await source.init(
|
||||||
|
|
Loading…
Reference in a new issue