Skip to content

armgit / ente

Public Imported from GitHub
0

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

Filter hidden collections from album selector dropdown

ashilkn437bc735a7cd
diff --git a/mobile/apps/photos/lib/ui/social/comments_screen.dart b/mobile/apps/photos/lib/ui/social/comments_screen.dart
index ff9baddeaa..97d4dda582 100644
--- a/mobile/apps/photos/lib/ui/social/comments_screen.dart
+++ b/mobile/apps/photos/lib/ui/social/comments_screen.dart
@@ -87,7 +87,7 @@ class _FileCommentsScreenState extends State<FileCommentsScreen> {
);
// Filter to shared collections first (sync operation)
- final sharedCollectionsList = collectionIDs
+ var sharedCollectionsList = collectionIDs
.map((id) => CollectionsService.instance.getCollectionByID(id))
.whereType<Collection>()
.where(
@@ -95,6 +95,17 @@ class _FileCommentsScreenState extends State<FileCommentsScreen> {
)
.toList();
+ // Filter out hidden collections unless viewing from a hidden collection
+ final hiddenCollectionIds =
+ CollectionsService.instance.getHiddenCollectionIds();
+ final isInitialCollectionHidden =
+ hiddenCollectionIds.contains(widget.collectionID);
+ if (!isInitialCollectionHidden) {
+ sharedCollectionsList = sharedCollectionsList
+ .where((c) => !hiddenCollectionIds.contains(c.id))
+ .toList();
+ }
+
// Fetch data in parallel
final sharedCollections = await Future.wait(
sharedCollectionsList.map((collection) async {
diff --git a/mobile/apps/photos/lib/ui/social/likes_bottom_sheet.dart b/mobile/apps/photos/lib/ui/social/likes_bottom_sheet.dart
index f7816c40f2..f4481e3a03 100644
--- a/mobile/apps/photos/lib/ui/social/likes_bottom_sheet.dart
+++ b/mobile/apps/photos/lib/ui/social/likes_bottom_sheet.dart
@@ -75,7 +75,7 @@ class _LikesBottomSheetState extends State<LikesBottomSheet> {
);
// Filter to shared collections only
- final sharedCollectionsList = collectionIDs
+ var sharedCollectionsList = collectionIDs
.map((id) => CollectionsService.instance.getCollectionByID(id))
.whereType<Collection>()
.where(
@@ -83,6 +83,17 @@ class _LikesBottomSheetState extends State<LikesBottomSheet> {
)
.toList();
+ // Filter out hidden collections unless viewing from a hidden collection
+ final hiddenCollectionIds =
+ CollectionsService.instance.getHiddenCollectionIds();
+ final isInitialCollectionHidden =
+ hiddenCollectionIds.contains(widget.initialCollectionID);
+ if (!isInitialCollectionHidden) {
+ sharedCollectionsList = sharedCollectionsList
+ .where((c) => !hiddenCollectionIds.contains(c.id))
+ .toList();
+ }
+
// Fetch like counts and thumbnails in parallel
final sharedCollections = await Future.wait(
sharedCollectionsList.map((collection) async {