about summary refs log tree commit diff
path: root/src/lib/strings
diff options
context:
space:
mode:
authorSamuel Newman <mozzius@protonmail.com>2025-06-18 19:25:14 +0300
committerGitHub <noreply@github.com>2025-06-18 09:25:14 -0700
commit06ebd2964ab68aa295f3385c188f40c33e3e0a23 (patch)
treec673a1770bce1d313666b5e9f77cea6e7c5d8239 /src/lib/strings
parent3304cd04249a2c39fa628b0339d6770bd26f8392 (diff)
downloadvoidsky-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')
-rw-r--r--src/lib/strings/url-helpers.ts5
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)