mirror of
https://github.com/immich-app/immich.git
synced 2024-12-25 10:43:13 +02:00
fix(web): back button on person page (#2566)
This commit is contained in:
parent
062e2eca6f
commit
1c293a2759
@ -1,5 +1,6 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { goto } from '$app/navigation';
|
import { afterNavigate, goto } from '$app/navigation';
|
||||||
|
import { page } from '$app/stores';
|
||||||
import ImageThumbnail from '$lib/components/assets/thumbnail/image-thumbnail.svelte';
|
import ImageThumbnail from '$lib/components/assets/thumbnail/image-thumbnail.svelte';
|
||||||
import EditNameInput from '$lib/components/faces-page/edit-name-input.svelte';
|
import EditNameInput from '$lib/components/faces-page/edit-name-input.svelte';
|
||||||
import CreateSharedLink from '$lib/components/photos-page/actions/create-shared-link.svelte';
|
import CreateSharedLink from '$lib/components/photos-page/actions/create-shared-link.svelte';
|
||||||
@ -22,10 +23,17 @@
|
|||||||
export let data: PageData;
|
export let data: PageData;
|
||||||
|
|
||||||
let isEditName = false;
|
let isEditName = false;
|
||||||
|
|
||||||
let multiSelectAsset: Set<AssetResponseDto> = new Set();
|
let multiSelectAsset: Set<AssetResponseDto> = new Set();
|
||||||
|
let previousRoute: string = AppRoute.EXPLORE;
|
||||||
$: isMultiSelectionMode = multiSelectAsset.size > 0;
|
$: isMultiSelectionMode = multiSelectAsset.size > 0;
|
||||||
|
|
||||||
|
afterNavigate(({ from }) => {
|
||||||
|
// Prevent setting previousRoute to the current page.
|
||||||
|
if (from && from.route.id !== $page.route.id) {
|
||||||
|
previousRoute = from.url.href;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
const handleNameChange = async (name: string) => {
|
const handleNameChange = async (name: string) => {
|
||||||
try {
|
try {
|
||||||
isEditName = false;
|
isEditName = false;
|
||||||
@ -60,7 +68,7 @@
|
|||||||
<ControlAppBar
|
<ControlAppBar
|
||||||
showBackButton
|
showBackButton
|
||||||
backIcon={ArrowLeft}
|
backIcon={ArrowLeft}
|
||||||
on:close-button-click={() => goto(AppRoute.EXPLORE)}
|
on:close-button-click={() => goto(previousRoute)}
|
||||||
/>
|
/>
|
||||||
{/if}
|
{/if}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user