From d1949d8a261bc93875c9c732553320feb34c4fae Mon Sep 17 00:00:00 2001 From: Niaz Date: Wed, 10 Jan 2024 18:45:52 +0100 Subject: [PATCH] Clear groups if refetching incomplete list --- src/layouts/dataviz/FaceDashboard.tsx | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/layouts/dataviz/FaceDashboard.tsx b/src/layouts/dataviz/FaceDashboard.tsx index c178abb5..5c4e1458 100644 --- a/src/layouts/dataviz/FaceDashboard.tsx +++ b/src/layouts/dataviz/FaceDashboard.tsx @@ -160,6 +160,12 @@ export function FaceDashboard() { /* eslint-disable-next-line react-hooks/exhaustive-deps */ }, [scrollTo]); + useEffect(() => { + if (fetchingInferredFacesList || fetchingLabeledFacesList) { + setGroups([]); + } + }, [fetchingInferredFacesList, fetchingLabeledFacesList]); + // ensure that the endpoint is not undefined const getEndpointCell = (cellContents, rowStopIndex, columnStopIndex) => { if (cellContents[rowStopIndex][columnStopIndex]) {