[mob][photos] Recompute suggestions on rejected suggestion

This commit is contained in:
laurenspriem 2024-04-24 17:15:11 +05:30
parent 72ff6e2cf3
commit 07458fb247

View file

@ -116,13 +116,6 @@ class _PersonClustersState extends State<PersonReviewClusterSuggestion> {
clusterID: clusterID, clusterID: clusterID,
); );
Bus.instance.fire(PeopleChangedEvent()); Bus.instance.fire(PeopleChangedEvent());
} else {
await FaceMLDataDB.instance.captureNotPersonFeedback(
personID: widget.person.remoteID,
clusterID: clusterID,
);
}
// Increment the suggestion index // Increment the suggestion index
if (mounted) { if (mounted) {
setState(() => currentSuggestionIndex++); setState(() => currentSuggestionIndex++);
@ -136,6 +129,18 @@ class _PersonClustersState extends State<PersonReviewClusterSuggestion> {
_fetchClusterSuggestions(); _fetchClusterSuggestions();
}); });
} }
} else {
await FaceMLDataDB.instance.captureNotPersonFeedback(
personID: widget.person.remoteID,
clusterID: clusterID,
);
// Recalculate the suggestions when a suggestion is rejected
setState(() {
currentSuggestionIndex = 0;
futureBuilderKey = UniqueKey(); // Reset to trigger FutureBuilder
_fetchClusterSuggestions();
});
}
} }
// Method to fetch cluster suggestions // Method to fetch cluster suggestions