#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) {
|
||||
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),
|
||||
|
|
|
@ -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(
|
||||
|
|
Loading…
Reference in a new issue