diff --git a/web/src/lib/components/faces-page/people-card.svelte b/web/src/lib/components/faces-page/people-card.svelte index 61b6565789..574c14b889 100644 --- a/web/src/lib/components/faces-page/people-card.svelte +++ b/web/src/lib/components/faces-page/people-card.svelte @@ -8,6 +8,7 @@ import MenuOption from '../shared-components/context-menu/menu-option.svelte'; import Portal from '../shared-components/portal/portal.svelte'; import { createEventDispatcher } from 'svelte'; + import { AppRoute } from '$lib/constants'; export let person: PersonResponseDto; @@ -42,7 +43,7 @@ on:mouseleave={() => (showVerticalDots = false)} role="group" > - +
{ - goto(`${AppRoute.PEOPLE}/${detail.id}?action=merge`); + goto(`${AppRoute.PEOPLE}/${detail.id}?action=merge&previousRoute=${AppRoute.PEOPLE}`); }; const submitNameChange = async () => { diff --git a/web/src/routes/(user)/people/[personId]/+page.svelte b/web/src/routes/(user)/people/[personId]/+page.svelte index 649d1bc771..dc1bf6398a 100644 --- a/web/src/routes/(user)/people/[personId]/+page.svelte +++ b/web/src/routes/(user)/people/[personId]/+page.svelte @@ -132,6 +132,10 @@ onMount(() => { const action = $page.url.searchParams.get('action'); + const getPreviousRoute = $page.url.searchParams.get('previousRoute'); + if (getPreviousRoute) { + previousRoute = getPreviousRoute; + } if (action == 'merge') { viewMode = ViewMode.MERGE_FACES; } @@ -176,7 +180,7 @@ type: NotificationType.Info, }); - goto(AppRoute.EXPLORE, { replaceState: true }); + goto(previousRoute, { replaceState: true }); } catch (error) { handleError(error, 'Unable to hide person'); }