mirror of
				https://github.com/KevinMidboe/immich.git
				synced 2025-10-29 17:40:28 +00:00 
			
		
		
		
	fix(web): back button on person page (#2566)
This commit is contained in:
		| @@ -1,5 +1,6 @@ | ||||
| <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 EditNameInput from '$lib/components/faces-page/edit-name-input.svelte'; | ||||
| 	import CreateSharedLink from '$lib/components/photos-page/actions/create-shared-link.svelte'; | ||||
| @@ -22,10 +23,17 @@ | ||||
| 	export let data: PageData; | ||||
|  | ||||
| 	let isEditName = false; | ||||
|  | ||||
| 	let multiSelectAsset: Set<AssetResponseDto> = new Set(); | ||||
| 	let previousRoute: string = AppRoute.EXPLORE; | ||||
| 	$: 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) => { | ||||
| 		try { | ||||
| 			isEditName = false; | ||||
| @@ -60,7 +68,7 @@ | ||||
| 	<ControlAppBar | ||||
| 		showBackButton | ||||
| 		backIcon={ArrowLeft} | ||||
| 		on:close-button-click={() => goto(AppRoute.EXPLORE)} | ||||
| 		on:close-button-click={() => goto(previousRoute)} | ||||
| 	/> | ||||
| {/if} | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user