π End-to-end encrypted cloud for everything.
Dart 2faandroidauthye2eeencryptionend-to-end-encryptionfluttergolanggoogle-photosgoogle-photos-alternativeiosopensourcephotosprivacyprivacy-toolstypescriptzero-knowledge
Cancel delay when navigating to search tab
laurenspriem2342998b21df
diff --git a/mobile/apps/photos/lib/states/all_sections_examples_state.dart b/mobile/apps/photos/lib/states/all_sections_examples_state.dartindex 982542e474..b15119356e 100644--- a/mobile/apps/photos/lib/states/all_sections_examples_state.dart+++ b/mobile/apps/photos/lib/states/all_sections_examples_state.dart@@ -40,6 +40,8 @@ class _AllSectionsExamplesProviderStatebool isOnSearchTab = false;bool _firstLoadInProgressOrComplete = false;final _logger = Logger("AllSectionsExamplesProvider");+ static const _initialLoadDelay = Duration(seconds: 10);+ Timer? _initialLoadTimer;final _debouncer = Debouncer(const Duration(seconds: 3),@@ -66,7 +68,8 @@ class _AllSectionsExamplesProviderStateif (event.source == TabChangedEventSource.pageView &&event.selectedIndex == 3) {isOnSearchTab = true;- if (hasPendingUpdate) {+ _cancelInitialLoadTimer();+ if (hasPendingUpdate || !_firstLoadInProgressOrComplete) {hasPendingUpdate = false;reloadAllSections();}@@ -75,7 +78,7 @@ class _AllSectionsExamplesProviderState}});- Future.delayed(const Duration(seconds: 3), () {+ _initialLoadTimer = Timer(_initialLoadDelay, () {if (!_firstLoadInProgressOrComplete) {reloadAllSections();}@@ -125,12 +128,18 @@ class _AllSectionsExamplesProviderState});}+ void _cancelInitialLoadTimer() {+ _initialLoadTimer?.cancel();+ _initialLoadTimer = null;+ }+@overridevoid dispose() {_onPeopleChangedEvent.cancel();_filesUpdatedEvent.cancel();_peopleSortChangedEvent.cancel();_tabChangeEvent.cancel();+ _cancelInitialLoadTimer();_debouncer.cancelDebounceTimer();super.dispose();}