Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

[mob][photos] Keep the Search ML progress banner steady

r4khuld2cc8ebac124
diff --git a/mobile/apps/photos/lib/ui/components/banners/ml_progress_banner.dart b/mobile/apps/photos/lib/ui/components/banners/ml_progress_banner.dart
index 9dea4e4efc..5d221adfa5 100644
--- a/mobile/apps/photos/lib/ui/components/banners/ml_progress_banner.dart
+++ b/mobile/apps/photos/lib/ui/components/banners/ml_progress_banner.dart
@@ -28,7 +28,7 @@ class MLProgressBanner extends StatefulWidget {
}
class _MLProgressBannerState extends State<MLProgressBanner>
- with WidgetsBindingObserver {
+ with WidgetsBindingObserver, AutomaticKeepAliveClientMixin {
IndexStatus? _indexStatus;
Timer? _timer;
bool _dismissed = false;
@@ -48,7 +48,6 @@ class _MLProgressBannerState extends State<MLProgressBanner>
_localPhotosUpdatedSubscription = Bus.instance
.on<LocalPhotosUpdatedEvent>()
.listen((_) {
- _indexStatus = null;
_indexingComplete = false;
_ensurePolling();
});
@@ -173,8 +172,12 @@ class _MLProgressBannerState extends State<MLProgressBanner>
super.dispose();
}
+ @override
+ bool get wantKeepAlive => true;
+
@override
Widget build(BuildContext context) {
+ super.build(context);
if (!_isShown) return const SizedBox.shrink();
final status = _indexStatus!;