Skip to content

armgit / ente

Public Imported from GitHub
0

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

Trigger

Manav Rathi7bd10ed78b86
diff --git a/web/apps/photos/src/components/ml/PeopleList.tsx b/web/apps/photos/src/components/ml/PeopleList.tsx
index cf7d6f54d2..6cd94aa9eb 100644
--- a/web/apps/photos/src/components/ml/PeopleList.tsx
+++ b/web/apps/photos/src/components/ml/PeopleList.tsx
@@ -86,7 +86,7 @@ export const UnidentifiedFaces: React.FC<UnidentifiedFacesProps> = ({
enteFile,
}) => {
const [faceIDs, setFaceIDs] = useState<string[]>([]);
- const [, setDidRegen] = useState(false);
+ const [didRegen, setDidRegen] = useState(false);
useEffect(() => {
let didCancel = false;
@@ -95,8 +95,9 @@ export const UnidentifiedFaces: React.FC<UnidentifiedFacesProps> = ({
const faceIDs = await unidentifiedFaceIDs(enteFile);
!didCancel && setFaceIDs(faceIDs);
// Don't block for the regeneration to happen. If anything got
- // regenerated, the result will be true, which'll cause our state to
- // change and us to be redrawn (and fetch the regenerated crops).
+ // regenerated, the result will be true, in response to which we'll
+ // change the key of the face list and cause it to be rerendered
+ // (fetching the regenerated crops).
void regenerateFaceCropsIfNeeded(enteFile).then((r) =>
setDidRegen(r),
);
@@ -114,7 +115,7 @@ export const UnidentifiedFaces: React.FC<UnidentifiedFacesProps> = ({
<div>
<Legend>{t("UNIDENTIFIED_FACES")}</Legend>
</div>
- <FaceChipContainer>
+ <FaceChipContainer key={didRegen ? 1 : 0}>
{faceIDs.map((faceID) => (
<FaceChip key={faceID}>
<FaceCropImageView {...{ faceID }} />