mirror of
https://github.com/immich-app/immich.git
synced 2025-05-24 01:12:58 -04:00
fix(web): previous previous route when hiding person (#4452)
This commit is contained in:
parent
9af5e7838f
commit
41af76bbe2
@ -8,6 +8,7 @@
|
|||||||
import MenuOption from '../shared-components/context-menu/menu-option.svelte';
|
import MenuOption from '../shared-components/context-menu/menu-option.svelte';
|
||||||
import Portal from '../shared-components/portal/portal.svelte';
|
import Portal from '../shared-components/portal/portal.svelte';
|
||||||
import { createEventDispatcher } from 'svelte';
|
import { createEventDispatcher } from 'svelte';
|
||||||
|
import { AppRoute } from '$lib/constants';
|
||||||
|
|
||||||
export let person: PersonResponseDto;
|
export let person: PersonResponseDto;
|
||||||
|
|
||||||
@ -42,7 +43,7 @@
|
|||||||
on:mouseleave={() => (showVerticalDots = false)}
|
on:mouseleave={() => (showVerticalDots = false)}
|
||||||
role="group"
|
role="group"
|
||||||
>
|
>
|
||||||
<a href="/people/{person.id}" draggable="false">
|
<a href="/people/{person.id}?previousRoute={AppRoute.PEOPLE}" draggable="false">
|
||||||
<div class="h-48 w-48 rounded-xl brightness-95 filter">
|
<div class="h-48 w-48 rounded-xl brightness-95 filter">
|
||||||
<ImageThumbnail
|
<ImageThumbnail
|
||||||
shadow
|
shadow
|
||||||
|
@ -245,7 +245,7 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
const handleMergeFaces = (detail: PersonResponseDto) => {
|
const handleMergeFaces = (detail: PersonResponseDto) => {
|
||||||
goto(`${AppRoute.PEOPLE}/${detail.id}?action=merge`);
|
goto(`${AppRoute.PEOPLE}/${detail.id}?action=merge&previousRoute=${AppRoute.PEOPLE}`);
|
||||||
};
|
};
|
||||||
|
|
||||||
const submitNameChange = async () => {
|
const submitNameChange = async () => {
|
||||||
|
@ -132,6 +132,10 @@
|
|||||||
|
|
||||||
onMount(() => {
|
onMount(() => {
|
||||||
const action = $page.url.searchParams.get('action');
|
const action = $page.url.searchParams.get('action');
|
||||||
|
const getPreviousRoute = $page.url.searchParams.get('previousRoute');
|
||||||
|
if (getPreviousRoute) {
|
||||||
|
previousRoute = getPreviousRoute;
|
||||||
|
}
|
||||||
if (action == 'merge') {
|
if (action == 'merge') {
|
||||||
viewMode = ViewMode.MERGE_FACES;
|
viewMode = ViewMode.MERGE_FACES;
|
||||||
}
|
}
|
||||||
@ -176,7 +180,7 @@
|
|||||||
type: NotificationType.Info,
|
type: NotificationType.Info,
|
||||||
});
|
});
|
||||||
|
|
||||||
goto(AppRoute.EXPLORE, { replaceState: true });
|
goto(previousRoute, { replaceState: true });
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
handleError(error, 'Unable to hide person');
|
handleError(error, 'Unable to hide person');
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user