From 35f24270feef04e045c52add572bb43c2ca3ae73 Mon Sep 17 00:00:00 2001 From: Pranay Pandey <79053599+Pranay-Pandey@users.noreply.github.com> Date: Thu, 14 Nov 2024 20:30:33 +0530 Subject: [PATCH] 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 --- .../[[photos=photos]]/[[assetId=id]]/+page.svelte | 2 ++ .../routes/(user)/sharing/sharedlinks/+page.svelte | 11 +++++++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/web/src/routes/(user)/albums/[albumId=id]/[[photos=photos]]/[[assetId=id]]/+page.svelte b/web/src/routes/(user)/albums/[albumId=id]/[[photos=photos]]/[[assetId=id]]/+page.svelte index 5b23cd0c2176e..7ee9c60a54ef7 100644 --- a/web/src/routes/(user)/albums/[albumId=id]/[[photos=photos]]/[[assetId=id]]/+page.svelte +++ b/web/src/routes/(user)/albums/[albumId=id]/[[photos=photos]]/[[assetId=id]]/+page.svelte @@ -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; } }); diff --git a/web/src/routes/(user)/sharing/sharedlinks/+page.svelte b/web/src/routes/(user)/sharing/sharedlinks/+page.svelte index 8ed4ae9fb6a1a..b7d4da2941812 100644 --- a/web/src/routes/(user)/sharing/sharedlinks/+page.svelte +++ b/web/src/routes/(user)/sharing/sharedlinks/+page.svelte @@ -1,5 +1,5 @@ - goto(AppRoute.SHARING)}> + goto(backUrl)}> {#snippet leading()} {$t('shared_links')} {/snippet}