π End-to-end encrypted cloud for everything.
Dart 2faandroidauthye2eeencryptionend-to-end-encryptionfluttergolanggoogle-photosgoogle-photos-alternativeiosopensourcephotosprivacyprivacy-toolstypescriptzero-knowledge
Move option back
laurenspriem7b0426800e43
diff --git a/mobile/apps/photos/lib/models/gallery_type.dart b/mobile/apps/photos/lib/models/gallery_type.dartindex 081388e958..9a773f1cb5 100644--- a/mobile/apps/photos/lib/models/gallery_type.dart+++ b/mobile/apps/photos/lib/models/gallery_type.dart@@ -271,6 +271,32 @@ extension GalleyTypeExtension on GalleryType {return this == GalleryType.favorite;}+ bool showAddToPersonOption() {+ switch (this) {+ case GalleryType.homepage:+ case GalleryType.archive:+ case GalleryType.uncategorized:+ case GalleryType.favorite:+ case GalleryType.ownedCollection:+ case GalleryType.searchResults:+ case GalleryType.locationTag:+ case GalleryType.peopleTag:+ case GalleryType.cluster:+ case GalleryType.magic:+ return true;++ case GalleryType.trash:+ case GalleryType.deleteSuggestions:+ case GalleryType.sharedCollection:+ case GalleryType.sharedPublicCollection:+ case GalleryType.quickLink:+ case GalleryType.localFolder:+ case GalleryType.hiddenSection:+ case GalleryType.hiddenOwnedCollection:+ return false;+ }+ }+bool showRestoreOption() {return this == GalleryType.trash;}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.dartindex b740774e46..4c5e68b24a 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@@ -277,18 +277,6 @@ class _FileSelectionActionsWidgetState}}- if (flagService.manualTagFileToPerson &&- widget.type != GalleryType.sharedPublicCollection) {- items.add(- SelectionActionButton(- icon: Icons.person_add_alt_1_outlined,- labelText: "(i) Add to person",- onTap: hasUploadedFileIDs ? _onAddFilesToPerson : null,- shouldShow: hasUploadedFileIDs,- ),- );- }-if (widget.type.showAddtoHiddenAlbum()) {items.add(SelectionActionButton(@@ -388,6 +376,18 @@ class _FileSelectionActionsWidgetStateonTap: _onGuestViewClick,),);++ if (flagService.manualTagFileToPerson &&+ widget.type.showAddToPersonOption()) {+ items.add(+ SelectionActionButton(+ icon: Icons.person_add_alt_1_outlined,+ labelText: "(i) Add to person",+ onTap: hasUploadedFileIDs ? _onAddFilesToPerson : null,+ shouldShow: hasUploadedFileIDs,+ ),+ );+ }if (widget.type != GalleryType.sharedPublicCollection) {items.add(SelectionActionButton(