Skip to content

armgit / ente

Public Imported from GitHub
0

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

Show delete action inside collaborative album

laurenspriem08ee4c1351e2
diff --git a/mobile/lib/models/gallery_type.dart b/mobile/lib/models/gallery_type.dart
index 82e5650b09..9b6b614695 100644
--- a/mobile/lib/models/gallery_type.dart
+++ b/mobile/lib/models/gallery_type.dart
@@ -104,6 +104,8 @@ extension GalleyTypeExtension on GalleryType {
bool showDeleteOption() {
switch (this) {
case GalleryType.ownedCollection:
+ case GalleryType.sharedCollection:
+ case GalleryType.sharedPublicCollection:
case GalleryType.searchResults:
case GalleryType.homepage:
case GalleryType.favorite:
@@ -119,8 +121,6 @@ extension GalleyTypeExtension on GalleryType {
case GalleryType.magic:
return true;
case GalleryType.trash:
- case GalleryType.sharedCollection:
- case GalleryType.sharedPublicCollection:
return false;
}
}
diff --git a/mobile/lib/ui/viewer/actions/file_selection_actions_widget.dart b/mobile/lib/ui/viewer/actions/file_selection_actions_widget.dart
index 02ca790c66..5f59aa73cd 100644
--- a/mobile/lib/ui/viewer/actions/file_selection_actions_widget.dart
+++ b/mobile/lib/ui/viewer/actions/file_selection_actions_widget.dart
@@ -134,6 +134,8 @@ class _FileSelectionActionsWidgetState
final bool anyOwnedFiles =
split.pendingUploads.isNotEmpty || split.ownedByCurrentUser.isNotEmpty;
+ final bool allOwnedFiles =
+ ownedAndPendingUploadFilesCount > 0 && split.ownedByOtherUsers.isEmpty;
final bool anyUploadedFiles = split.ownedByCurrentUser.isNotEmpty;
final showCollageOption = CollageCreatorPage.isValidCount(
@@ -259,7 +261,7 @@ class _FileSelectionActionsWidgetState
icon: Icons.delete_outline,
labelText: S.of(context).delete,
onTap: anyOwnedFiles ? _onDeleteClick : null,
- shouldShow: ownedAndPendingUploadFilesCount > 0,
+ shouldShow: allOwnedFiles,
),
);
}