Skip to content

armgit / ente

Public Imported from GitHub
0

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

Hide gallery filters in local gallery mode

ashilknac4326be9c29
diff --git a/mobile/apps/photos/changes/local-gallery-filter-row.md b/mobile/apps/photos/changes/local-gallery-filter-row.md
new file mode 100644
index 0000000000..8b21448b77
--- /dev/null
+++ b/mobile/apps/photos/changes/local-gallery-filter-row.md
@@ -0,0 +1 @@
+- Fixed extra app bar space in local gallery mode galleries.
diff --git a/mobile/apps/photos/lib/ui/viewer/gallery/gallery.dart b/mobile/apps/photos/lib/ui/viewer/gallery/gallery.dart
index 5a5efade11..2ec9318ca7 100644
--- a/mobile/apps/photos/lib/ui/viewer/gallery/gallery.dart
+++ b/mobile/apps/photos/lib/ui/viewer/gallery/gallery.dart
@@ -572,8 +572,11 @@ class GalleryState extends State<Gallery> {
if (!mounted) {
return result;
}
+ final inheritedSearchFilterData = _inheritedSearchFilterData;
final searchFilterDataProvider =
- _inheritedSearchFilterData?.searchFilterDataProvider;
+ inheritedSearchFilterData?.isHierarchicalSearchable == true
+ ? inheritedSearchFilterData!.searchFilterDataProvider
+ : null;
if (searchFilterDataProvider != null &&
!searchFilterDataProvider.isSearchingNotifier.value) {
unawaited(
diff --git a/mobile/apps/photos/lib/ui/viewer/gallery/state/inherited_search_filter_data.dart b/mobile/apps/photos/lib/ui/viewer/gallery/state/inherited_search_filter_data.dart
index ff0cd40a7a..d5ebdc7d17 100644
--- a/mobile/apps/photos/lib/ui/viewer/gallery/state/inherited_search_filter_data.dart
+++ b/mobile/apps/photos/lib/ui/viewer/gallery/state/inherited_search_filter_data.dart
@@ -1,4 +1,5 @@
import "package:flutter/material.dart";
+import "package:photos/service_locator.dart" show isLocalGalleryMode;
import "package:photos/ui/viewer/gallery/state/search_filter_data_provider.dart";
class InheritedSearchFilterDataWrapper extends StatefulWidget {
@@ -45,7 +46,8 @@ class InheritedSearchFilterData extends InheritedWidget {
/// Pass null if gallery doesn't need hierarchical search
final SearchFilterDataProvider? searchFilterDataProvider;
- bool get isHierarchicalSearchable => searchFilterDataProvider != null;
+ bool get isHierarchicalSearchable =>
+ searchFilterDataProvider != null && !isLocalGalleryMode;
static InheritedSearchFilterData? maybeOf(BuildContext context) {
return context