[mob][photos] Quick fix undo

This commit is contained in:
laurenspriem
2024-11-26 21:35:54 +05:30
parent bf7d6a5f03
commit 4dd22a646d

View File

@@ -185,7 +185,15 @@ class PersonService {
final personData = person.data;
final clusterInfo = personData.assigned!.firstWhere(
(element) => element.id == clusterID,
orElse: () => ClusterInfo(id: "noSuchClusterInRemotePerson", faces: {}),
);
if (clusterInfo.id == "noSuchClusterInRemotePerson") {
await MLDataDB.instance.removeClusterToPerson(
personID: personID,
clusterID: clusterID,
);
return;
}
personData.rejectedFaceIDs ??= [];
personData.rejectedFaceIDs!.addAll(clusterInfo.faces);
personData.assigned!.removeWhere((element) => element.id != clusterID);