π End-to-end encrypted cloud for everything.
Dart 2faandroidauthye2eeencryptionend-to-end-encryptionfluttergolanggoogle-photosgoogle-photos-alternativeiosopensourcephotosprivacyprivacy-toolstypescriptzero-knowledge
Allow editing people without assigned clusters
Neeraj Guptab13abb64a02a
diff --git a/mobile/apps/photos/lib/ui/viewer/actions/people_selection_action_widget.dart b/mobile/apps/photos/lib/ui/viewer/actions/people_selection_action_widget.dartindex ef5765c854..57c5c40122 100644--- a/mobile/apps/photos/lib/ui/viewer/actions/people_selection_action_widget.dart+++ b/mobile/apps/photos/lib/ui/viewer/actions/people_selection_action_widget.dart@@ -126,7 +126,7 @@ class _PeopleSelectionActionWidgetStateselectedPersonIds.every((id) => (personMap[id]?.data.name ?? "").isNotEmpty,);- final bool showEditAction = onlySelectedPersonHasAssignedCluster;+ final bool showEditAction = onlyOnePerson;final bool showReviewAction = onlySelectedPersonHasAssignedCluster;final bool showMergeAction = onlyIgnoredPersonsSelected? false@@ -321,15 +321,13 @@ class _PeopleSelectionActionWidgetStatefinal personID = selectedPersonIds.first;final person = personMap[personID];if (person == null) return;- if (person.data.assigned.isEmpty) return;+ final clusterID = person.data.assigned.isEmpty+ ? null+ : person.data.assigned.first.id;await routeToPage(context,- SaveOrEditPerson(- person.data.assigned.first.id,- person: person,- isEditing: true,- ),+ SaveOrEditPerson(clusterID, person: person, isEditing: true),);widget.selectedPeople.clearAll();}diff --git a/mobile/apps/photos/lib/ui/viewer/people/people_app_bar.dart b/mobile/apps/photos/lib/ui/viewer/people/people_app_bar.dartindex 4e953cda48..cd17413e94 100644--- a/mobile/apps/photos/lib/ui/viewer/people/people_app_bar.dart+++ b/mobile/apps/photos/lib/ui/viewer/people/people_app_bar.dart@@ -250,16 +250,12 @@ class _AppBarWidgetState extends State<PeopleAppBar> {}Future<dynamic> _editPerson(BuildContext context) async {- if (person.data.assigned.isEmpty) {- return;- }+ final clusterID = person.data.assigned.isEmpty+ ? null+ : person.data.assigned.first.id;final result = await routeToPage(context,- SaveOrEditPerson(- person.data.assigned.first.id,- person: person,- isEditing: true,- ),+ SaveOrEditPerson(clusterID, person: person, isEditing: true),);if (result is PersonEntity) {_appBarTitle = result.data.name;@@ -299,15 +295,14 @@ class _AppBarWidgetState extends State<PeopleAppBar> {if (!isIgnored) {items.addAll([- if (hasAssignedCluster)- EntePopupMenuOption(- value: PeoplePopupAction.rename,- label: AppLocalizations.of(context).edit,- leadingWidget: galleryAppBarMenuIcon(- HugeIcons.strokeRoundedPencilEdit01,- iconColor,- ),+ EntePopupMenuOption(+ value: PeoplePopupAction.rename,+ label: AppLocalizations.of(context).edit,+ leadingWidget: galleryAppBarMenuIcon(+ HugeIcons.strokeRoundedPencilEdit01,+ iconColor,),+ ),if (hasAssignedCluster)EntePopupMenuOption(value: PeoplePopupAction.reviewSuggestions,@@ -377,15 +372,14 @@ class _AppBarWidgetState extends State<PeopleAppBar> {]);} else {items.addAll([- if (hasAssignedCluster)- EntePopupMenuOption(- value: PeoplePopupAction.rename,- label: AppLocalizations.of(context).edit,- leadingWidget: galleryAppBarMenuIcon(- HugeIcons.strokeRoundedPencilEdit01,- iconColor,- ),+ EntePopupMenuOption(+ value: PeoplePopupAction.rename,+ label: AppLocalizations.of(context).edit,+ leadingWidget: galleryAppBarMenuIcon(+ HugeIcons.strokeRoundedPencilEdit01,+ iconColor,),+ ),if (hasAssignedCluster)EntePopupMenuOption(value: PeoplePopupAction.reviewSuggestions,