Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion web/src/lib/utils/navigation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export function currentUrlReplaceAssetId(assetId: string) {
// off / instead of a subpath, unlike every other asset-containing route.
return isPhotosRoute($page.route.id)
? `${AppRoute.PHOTOS}/${assetId}${searchparams}`
: `${$page.url.pathname.replace(/(\/photos.*)$/, '')}/photos/${assetId}${searchparams}`;
: `${$page.url.pathname.replace(/\/photos\/[^/]+$/, '')}/photos/${assetId}${searchparams}`;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure if we want [^/]+ or .*. Currently this only catches exactly one case though where there isn't a deeper path so it is probably fine

}

function replaceScrollTarget(url: string, searchParams?: AssetGridRouteSearchParams | null) {
Expand Down
Loading