Skip to content

armgit / ente

Public Imported from GitHub
0

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

fix: issues

Prateek Sunalc19321c30b2e
diff --git a/mobile/apps/photos/lib/ui/viewer/actions/file_selection_actions_widget.dart b/mobile/apps/photos/lib/ui/viewer/actions/file_selection_actions_widget.dart
index 1b13354bb2..646de6c454 100644
--- a/mobile/apps/photos/lib/ui/viewer/actions/file_selection_actions_widget.dart
+++ b/mobile/apps/photos/lib/ui/viewer/actions/file_selection_actions_widget.dart
@@ -957,7 +957,6 @@ class _FileSelectionActionsWidgetState
try {
final actionResult = await showActionSheet(
context: context,
- useRootNavigator: true,
buttons: [
ButtonWidget(
labelText: AppLocalizations.of(context).yesRemove,
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 c1df7eeccf..a32b7dbd55 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,19 +111,24 @@ class _FileSelectionOverlayBarState extends State<FileSelectionOverlayBar>
return _galleryType == GalleryType.homepage
? _body()
- : ValueListenableBuilder(
- valueListenable: _hasSelectedFilesNotifier,
- builder: (context, hasSelectedFiles, child) {
- return PopScope(
- canPop: !hasSelectedFiles,
- onPopInvokedWithResult: (didPop, _) {
- if (!didPop) {
- widget.selectedFiles.clearAll();
- }
- },
- child: _body(),
- );
+ : PopScope(
+ // iOS pop gesture get's blocked if we do canPop false, so always pop on iOS
+ canPop: Platform.isIOS,
+ onPopInvokedWithResult: (didPop, _) {
+ // for iOS return and don't run anything
+ if (didPop) return;
+
+ // Android specific block
+ // if nothing is selected then pop the page
+ if (widget.selectedFiles.files.isEmpty) {
+ Navigator.of(context).pop();
+ return;
+ }
+
+ // clear all selections if something is selected
+ widget.selectedFiles.clearAll();
},
+ child: _body(),
);
}