From 71982d5557b62b8501cc7bf5bbb230b2387283df Mon Sep 17 00:00:00 2001 From: Manav Rathi Date: Fri, 11 Oct 2024 19:27:49 +0530 Subject: [PATCH] Show the error inline --- .../photos/components/gallery/PeopleHeader.tsx | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/web/packages/new/photos/components/gallery/PeopleHeader.tsx b/web/packages/new/photos/components/gallery/PeopleHeader.tsx index e493587c34..7cd148506f 100644 --- a/web/packages/new/photos/components/gallery/PeopleHeader.tsx +++ b/web/packages/new/photos/components/gallery/PeopleHeader.tsx @@ -87,7 +87,7 @@ const CGroupPersonHeader: React.FC = ({ renameCGroup(cgroup, name), ); - const handleDeletePerson = () => + const handleReset = () => showMiniDialog({ title: pt("Reset person?"), message: pt( @@ -96,16 +96,14 @@ const CGroupPersonHeader: React.FC = ({ continue: { text: t("reset"), color: "primary", - action: deletePerson, + action: async () => { + await deleteCGroup(cgroup); + // Reset the selection to the default state. + onSelectPerson(undefined); + }, }, }); - const deletePerson = useWrapAsyncOperation(async () => { - await deleteCGroup(cgroup); - // Reset the selection to the default state. - onSelectPerson(undefined); - }); - // While technically it is possible for the cgroup not to have a name, // logical wise we shouldn't be ending up here without a name. const name = cgroup.data.name ?? ""; @@ -130,7 +128,7 @@ const CGroupPersonHeader: React.FC = ({ } centerAlign - onClick={handleDeletePerson} + onClick={handleReset} > {pt("Reset")}