Ensure `/start` navigates to `/starter-pack` when clicking a link internally (#4745)
* remove temporary metadata removal * ensure proper navigationzio/stable
parent
6b5e3181fb
commit
a6b3c97df0
|
@ -5,6 +5,7 @@ import TLDs from 'tlds'
|
||||||
import {logger} from '#/logger'
|
import {logger} from '#/logger'
|
||||||
import {BSKY_SERVICE} from 'lib/constants'
|
import {BSKY_SERVICE} from 'lib/constants'
|
||||||
import {isInvalidHandle} from 'lib/strings/handles'
|
import {isInvalidHandle} from 'lib/strings/handles'
|
||||||
|
import {startUriToStarterPackUri} from 'lib/strings/starter-pack'
|
||||||
|
|
||||||
export const BSKY_APP_HOST = 'https://bsky.app'
|
export const BSKY_APP_HOST = 'https://bsky.app'
|
||||||
const BSKY_TRUSTED_HOSTS = [
|
const BSKY_TRUSTED_HOSTS = [
|
||||||
|
@ -187,6 +188,11 @@ export function convertBskyAppUrlIfNeeded(url: string): string {
|
||||||
if (isBskyAppUrl(url)) {
|
if (isBskyAppUrl(url)) {
|
||||||
try {
|
try {
|
||||||
const urlp = new URL(url)
|
const urlp = new URL(url)
|
||||||
|
|
||||||
|
if (isBskyStartUrl(url)) {
|
||||||
|
return startUriToStarterPackUri(urlp.pathname)
|
||||||
|
}
|
||||||
|
|
||||||
return urlp.pathname
|
return urlp.pathname
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error('Unexpected error in convertBskyAppUrlIfNeeded()', e)
|
console.error('Unexpected error in convertBskyAppUrlIfNeeded()', e)
|
||||||
|
|
|
@ -79,7 +79,6 @@ export const ExternalLinkEmbed = ({
|
||||||
) : embedPlayerParams ? (
|
) : embedPlayerParams ? (
|
||||||
<ExternalPlayer link={link} params={embedPlayerParams} />
|
<ExternalPlayer link={link} params={embedPlayerParams} />
|
||||||
) : undefined}
|
) : undefined}
|
||||||
{!starterPackParsed ? (
|
|
||||||
<View
|
<View
|
||||||
style={[
|
style={[
|
||||||
a.flex_1,
|
a.flex_1,
|
||||||
|
@ -109,7 +108,6 @@ export const ExternalLinkEmbed = ({
|
||||||
</Text>
|
</Text>
|
||||||
) : undefined}
|
) : undefined}
|
||||||
</View>
|
</View>
|
||||||
) : null}
|
|
||||||
</LinkWrapper>
|
</LinkWrapper>
|
||||||
</View>
|
</View>
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in New Issue