diff options
author | Samuel Newman <mozzius@protonmail.com> | 2025-06-18 19:25:14 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-06-18 09:25:14 -0700 |
commit | 06ebd2964ab68aa295f3385c188f40c33e3e0a23 (patch) | |
tree | c673a1770bce1d313666b5e9f77cea6e7c5d8239 /src/lib/strings/url-helpers.ts | |
parent | 3304cd04249a2c39fa628b0339d6770bd26f8392 (diff) | |
download | voidsky-06ebd2964ab68aa295f3385c188f40c33e3e0a23.tar.zst |
Fix linking to specific search results (#8520)
* fix linking to bsky.app/search?q=xyz * add name to comment * skip if notfound
Diffstat (limited to 'src/lib/strings/url-helpers.ts')
-rw-r--r-- | src/lib/strings/url-helpers.ts | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/lib/strings/url-helpers.ts b/src/lib/strings/url-helpers.ts index ad194714a..288f428c1 100644 --- a/src/lib/strings/url-helpers.ts +++ b/src/lib/strings/url-helpers.ts @@ -193,6 +193,11 @@ export function convertBskyAppUrlIfNeeded(url: string): string { return startUriToStarterPackUri(urlp.pathname) } + // special-case search links + if (urlp.pathname === '/search') { + return `/search?q=${urlp.searchParams.get('q')}` + } + return urlp.pathname } catch (e) { console.error('Unexpected error in convertBskyAppUrlIfNeeded()', e) |