Skip to content

armgit / ente

Public Imported from GitHub
0

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

[mob][photos] Move archived shared albums to Archive (#12538)

Aman Raj7d99b770f2c0
diff --git a/mobile/apps/photos/changes/archived-shared-albums.md b/mobile/apps/photos/changes/archived-shared-albums.md
new file mode 100644
index 0000000000..f9fd3fdead
--- /dev/null
+++ b/mobile/apps/photos/changes/archived-shared-albums.md
@@ -0,0 +1 @@
+- Shared and received albums now move to Archive and back.
diff --git a/mobile/apps/photos/lib/services/collections_service.dart b/mobile/apps/photos/lib/services/collections_service.dart
index 03e89a774a..b3e88b7b40 100644
--- a/mobile/apps/photos/lib/services/collections_service.dart
+++ b/mobile/apps/photos/lib/services/collections_service.dart
@@ -353,7 +353,7 @@ class CollectionsService {
}
Future<List<Collection>> getArchivedCollection() async {
- final allCollections = getCollectionsForUI();
+ final allCollections = getCollectionsForUI(includedShared: true);
return allCollections
.where((c) => c.isArchived() && !c.isHidden())
.toList();
@@ -636,12 +636,13 @@ class CollectionsService {
);
for (final c in collections) {
if (c.owner.id == Configuration.instance.getUserID()) {
- if (c.hasSharees || c.hasLink && !c.isQuickLinkCollection()) {
+ if (!c.isArchived() &&
+ (c.hasSharees || c.hasLink && !c.isQuickLinkCollection())) {
outgoing.add(c);
} else if (c.isQuickLinkCollection()) {
quickLinks.add(c);
}
- } else {
+ } else if (!c.isArchived()) {
incoming.add(c);
}
}
diff --git a/mobile/apps/photos/lib/ui/viewer/actions/album_selection_action_widget.dart b/mobile/apps/photos/lib/ui/viewer/actions/album_selection_action_widget.dart
index ef2b26a846..f906dac980 100644
--- a/mobile/apps/photos/lib/ui/viewer/actions/album_selection_action_widget.dart
+++ b/mobile/apps/photos/lib/ui/viewer/actions/album_selection_action_widget.dart
@@ -171,6 +171,7 @@ class _AlbumSelectionActionWidgetState
hugeIcon: HugeIcons.strokeRoundedDelete01,
onTap: _trashCollection,
isCritical: true,
+ shouldShow: ownsAllSelectedAlbums,
),
);
} else if (widget.sectionType == UISectionType.hiddenCollections) {
@@ -591,9 +592,7 @@ class _AlbumSelectionActionWidgetState
}
bool _usesShareeMetadata(Collection collection) {
- return widget.sectionType == UISectionType.incomingCollections ||
- widget.sectionType == UISectionType.homeCollections &&
- !collection.isOwner(Configuration.instance.getUserID()!);
+ return !collection.isOwner(Configuration.instance.getUserID()!);
}
Future<void> _leaveAlbum() async {
diff --git a/mobile/apps/photos/lib/ui/viewer/gallery/gallery_app_bar_widget.dart b/mobile/apps/photos/lib/ui/viewer/gallery/gallery_app_bar_widget.dart
index 584415e1e5..c58ed016fc 100644
--- a/mobile/apps/photos/lib/ui/viewer/gallery/gallery_app_bar_widget.dart
+++ b/mobile/apps/photos/lib/ui/viewer/gallery/gallery_app_bar_widget.dart
@@ -787,7 +787,8 @@ class _GalleryAppBarWidgetState extends State<GalleryAppBarWidget> {
galleryAppBarMenuIcon(HugeIcons.strokeRoundedDelete01, warningColor),
labelColor: warningColor,
),
- if (isArchived || (galleryType.canArchive() && !isHidden))
+ if (galleryType != GalleryType.sharedCollection &&
+ (isArchived || (galleryType.canArchive() && !isHidden)))
_menuOption(
AlbumPopupAction.ownedArchive,
isArchived ? strings.unarchiveAlbum : strings.archiveAlbum,