diff --git a/src/lib/strings/url-helpers.ts b/src/lib/strings/url-helpers.ts index 742c7ef7..0407df75 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) diff --git a/src/view/com/util/post-embeds/ExternalLinkEmbed.tsx b/src/view/com/util/post-embeds/ExternalLinkEmbed.tsx index e7fd6cb8..cc742c8c 100644 --- a/src/view/com/util/post-embeds/ExternalLinkEmbed.tsx +++ b/src/view/com/util/post-embeds/ExternalLinkEmbed.tsx @@ -79,37 +79,35 @@ export const ExternalLinkEmbed = ({ ) : embedPlayerParams ? ( ) : undefined} - {!starterPackParsed ? ( - - - {toNiceDomain(link.uri)} - + + + {toNiceDomain(link.uri)} + - {!embedPlayerParams?.isGif && !embedPlayerParams?.dimensions && ( - - {link.title || link.uri} - - )} - {link.description ? ( - - {link.description} - - ) : undefined} - - ) : null} + {!embedPlayerParams?.isGif && !embedPlayerParams?.dimensions && ( + + {link.title || link.uri} + + )} + {link.description ? ( + + {link.description} + + ) : undefined} + )