Skip to content

armgit / ente

Public Imported from GitHub
0

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

[mob] Fix nav bug during person label assignment

Neeraj Guptaa4de4fe4b7cb
diff --git a/mobile/lib/ui/viewer/people/add_person_action_sheet.dart b/mobile/lib/ui/viewer/people/add_person_action_sheet.dart
index ecfa6b56b5..b63034c440 100644
--- a/mobile/lib/ui/viewer/people/add_person_action_sheet.dart
+++ b/mobile/lib/ui/viewer/people/add_person_action_sheet.dart
@@ -290,6 +290,7 @@ class _PersonActionSheetState extends State<PersonActionSheet> {
String initValue = '',
required String clusterID,
}) async {
+ PersonEntity? personEntity;
final result = await showTextInputDialog(
context,
title: S.of(context).newPerson,
@@ -308,15 +309,14 @@ class _PersonActionSheetState extends State<PersonActionSheet> {
}
try {
userAlreadyAssigned = true;
- final PersonEntity p =
+ personEntity =
await PersonService.instance.addPerson(text, clusterID);
final bool extraPhotosFound = await ClusterFeedbackService.instance
- .checkAndDoAutomaticMerges(p, personClusterID: clusterID);
+ .checkAndDoAutomaticMerges(personEntity!,
+ personClusterID: clusterID);
if (extraPhotosFound) {
showShortToast(context, S.of(context).extraPhotosFound);
}
- Bus.instance.fire(PeopleChangedEvent());
- Navigator.pop(context, p);
} catch (e, s) {
Logger("_PersonActionSheetState")
.severe("Failed to add person", e, s);
@@ -327,6 +327,10 @@ class _PersonActionSheetState extends State<PersonActionSheet> {
if (result is Exception) {
await showGenericErrorDialog(context: context, error: result);
}
+ if (personEntity != null) {
+ Bus.instance.fire(PeopleChangedEvent());
+ Navigator.pop(context, personEntity);
+ }
}
Future<List<(PersonEntity, EnteFile)>> _getPersonsWithRecentFile({