fix(web): previous previous route when hiding person (#4452)

This commit is contained in:
martin
2023-10-12 17:31:34 +02:00
committed by GitHub
parent 9af5e7838f
commit 41af76bbe2
3 changed files with 8 additions and 3 deletions

View File

@@ -245,7 +245,7 @@
};
const handleMergeFaces = (detail: PersonResponseDto) => {
goto(`${AppRoute.PEOPLE}/${detail.id}?action=merge`);
goto(`${AppRoute.PEOPLE}/${detail.id}?action=merge&previousRoute=${AppRoute.PEOPLE}`);
};
const submitNameChange = async () => {

View File

@@ -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');
}