From 451c26ef4dcd0315d774e2629ecbdea15c4c1bc4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Ventura?= Date: Tue, 28 Jan 2025 09:02:35 +0000 Subject: [PATCH] fix(web): cancel people merge selection: do not show "Change name successfully" notification. --- .../[[photos=photos]]/[[assetId=id]]/+page.svelte | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/web/src/routes/(user)/people/[personId]/[[photos=photos]]/[[assetId=id]]/+page.svelte b/web/src/routes/(user)/people/[personId]/[[photos=photos]]/[[assetId=id]]/+page.svelte index 5ea5898c2d2a4..00a5284452a06 100644 --- a/web/src/routes/(user)/people/[personId]/[[photos=photos]]/[[assetId=id]]/+page.svelte +++ b/web/src/routes/(user)/people/[personId]/[[photos=photos]]/[[assetId=id]]/+page.svelte @@ -92,6 +92,7 @@ let personMerge1: PersonResponseDto | undefined = $state(); let personMerge2: PersonResponseDto | undefined = $state(); let potentialMergePeople: PersonResponseDto[] = $state([]); + let isSuggestionSelectedByUser = $state(false); let personName = ''; let suggestedPeople: PersonResponseDto[] = $state([]); @@ -233,15 +234,22 @@ personName = person.name; personMerge1 = person; personMerge2 = person2; + isSuggestionSelectedByUser = true; viewMode = PersonPageViewMode.SUGGEST_MERGE; }; const changeName = async () => { viewMode = PersonPageViewMode.VIEW_ASSETS; person.name = personName; - try { - isEditingName = false; + isEditingName = false; + + if (isSuggestionSelectedByUser) { + // User canceled the merge + isSuggestionSelectedByUser = false; + return; + } + try { person = await updatePerson({ id: person.id, personUpdateDto: { name: personName } }); notificationController.show({