From a6b3c97df0fa93e6a0d2ebf33824e8a1c5699ef9 Mon Sep 17 00:00:00 2001 From: Hailey Date: Sun, 7 Jul 2024 05:07:28 -0700 Subject: Ensure `/start` navigates to `/starter-pack` when clicking a link internally (#4745) * remove temporary metadata removal * ensure proper navigation --- src/lib/strings/url-helpers.ts | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/lib/strings/url-helpers.ts') diff --git a/src/lib/strings/url-helpers.ts b/src/lib/strings/url-helpers.ts index 742c7ef79..0407df757 100644 --- a/src/lib/strings/url-helpers.ts +++ b/src/lib/strings/url-helpers.ts @@ -5,6 +5,7 @@ import TLDs from 'tlds' import {logger} from '#/logger' import {BSKY_SERVICE} from 'lib/constants' import {isInvalidHandle} from 'lib/strings/handles' +import {startUriToStarterPackUri} from 'lib/strings/starter-pack' export const BSKY_APP_HOST = 'https://bsky.app' const BSKY_TRUSTED_HOSTS = [ @@ -187,6 +188,11 @@ export function convertBskyAppUrlIfNeeded(url: string): string { if (isBskyAppUrl(url)) { try { const urlp = new URL(url) + + if (isBskyStartUrl(url)) { + return startUriToStarterPackUri(urlp.pathname) + } + return urlp.pathname } catch (e) { console.error('Unexpected error in convertBskyAppUrlIfNeeded()', e) -- cgit 1.4.1