Skip to content

Commit

Permalink
Merge pull request #407 from LibrePhotos/fix/librephotos#1067
Browse files Browse the repository at this point in the history
Force refetching faces when adding a new person
  • Loading branch information
derneuere authored Nov 13, 2023
2 parents 859a116 + eda8688 commit 58fd743
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/components/modals/ModalPersonEdit.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import { fuzzyMatch } from "../../util/util";
type Props = {
isOpen: boolean;
onRequestClose: () => void;
resetGroups: () => void;
selectedFaces: any[];
};

Expand All @@ -25,7 +26,7 @@ export function ModalPersonEdit(props: Props) {

const dispatch = useAppDispatch();
const { t } = useTranslation();
const { isOpen, onRequestClose, selectedFaces } = props;
const { isOpen, onRequestClose, selectedFaces, resetGroups } = props;
let filteredPeopleList = people;

if (newPersonName.length > 0) {
Expand Down Expand Up @@ -94,6 +95,7 @@ export function ModalPersonEdit(props: Props) {
title: i18n.t<string>("toasts.addfacestopersontitle"),
color: "teal",
});
resetGroups();
onRequestClose();
setNewPersonName("");
}}
Expand Down
4 changes: 4 additions & 0 deletions src/layouts/dataviz/FaceDashboard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -385,6 +385,10 @@ export function FaceDashboard() {
setModalPersonEditOpen(false);
setSelectedFaces([]);
}}
resetGroups={() => {
// Reset groups to force refetch of faces when adding faces to a person
setGroups([]);
}}
selectedFaces={selectedFaces}
/>
{lightboxShow && (
Expand Down

0 comments on commit 58fd743

Please sign in to comment.