Skip to content

armgit / ente

Public Imported from GitHub
0

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

listen to has files notifier

Prateek Sunal8a5895c407b1
diff --git a/mobile/apps/photos/lib/ui/viewer/actions/file_selection_overlay_bar.dart b/mobile/apps/photos/lib/ui/viewer/actions/file_selection_overlay_bar.dart
index 1f32d66e5e..c1df7eeccf 100644
--- a/mobile/apps/photos/lib/ui/viewer/actions/file_selection_overlay_bar.dart
+++ b/mobile/apps/photos/lib/ui/viewer/actions/file_selection_overlay_bar.dart
@@ -111,14 +111,19 @@ class _FileSelectionOverlayBarState extends State<FileSelectionOverlayBar>
return _galleryType == GalleryType.homepage
? _body()
- : PopScope(
- canPop: widget.selectedFiles.files.isEmpty,
- onPopInvokedWithResult: (didPop, _) {
- if (!didPop) {
- widget.selectedFiles.clearAll();
- }
+ : ValueListenableBuilder(
+ valueListenable: _hasSelectedFilesNotifier,
+ builder: (context, hasSelectedFiles, child) {
+ return PopScope(
+ canPop: !hasSelectedFiles,
+ onPopInvokedWithResult: (didPop, _) {
+ if (!didPop) {
+ widget.selectedFiles.clearAll();
+ }
+ },
+ child: _body(),
+ );
},
- child: _body(),
);
}