mirror of
https://github.com/immich-app/immich.git
synced 2024-11-24 08:52:28 +02:00
fix: Routing back button in sharedLinks page (#13703)
* fix: go back to last page from shared links page. Handle albums page from shared links page routing * add default route for sharing * chore: remove redundant import * remove unnecessary comment --------- Co-authored-by: Alex Tran <alex.tran1502@gmail.com>
This commit is contained in:
parent
1f1a4ab1a3
commit
35f24270fe
@ -128,6 +128,8 @@
|
||||
|
||||
if (backUrl === AppRoute.SHARING && album.albumUsers.length === 0 && !album.hasSharedLink) {
|
||||
isCreatingSharedAlbum = true;
|
||||
} else if (backUrl === AppRoute.SHARED_LINKS) {
|
||||
backUrl = history.state?.backUrl || AppRoute.ALBUMS;
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
<script lang="ts">
|
||||
import { goto } from '$app/navigation';
|
||||
import { goto, afterNavigate } from '$app/navigation';
|
||||
import ControlAppBar from '$lib/components/shared-components/control-app-bar.svelte';
|
||||
import CreateSharedLinkModal from '$lib/components/shared-components/create-share-link-modal/create-shared-link-modal.svelte';
|
||||
import {
|
||||
@ -50,9 +50,16 @@
|
||||
await refresh();
|
||||
editSharedLink = null;
|
||||
};
|
||||
|
||||
let backUrl: string = AppRoute.SHARING;
|
||||
|
||||
afterNavigate(({ from }) => {
|
||||
let url: string | undefined = from?.url?.pathname;
|
||||
backUrl = url || AppRoute.SHARING;
|
||||
});
|
||||
</script>
|
||||
|
||||
<ControlAppBar backIcon={mdiArrowLeft} onClose={() => goto(AppRoute.SHARING)}>
|
||||
<ControlAppBar backIcon={mdiArrowLeft} onClose={() => goto(backUrl)}>
|
||||
{#snippet leading()}
|
||||
{$t('shared_links')}
|
||||
{/snippet}
|
||||
|
Loading…
Reference in New Issue
Block a user