From 279f717f3091c9df8c73ba35f9a038e12f5a1122 Mon Sep 17 00:00:00 2001 From: Hailey Date: Tue, 23 Apr 2024 10:45:13 -0700 Subject: [PATCH] TODO REVERT THESE CHANGES --- src/Navigation.tsx | 7 ++++++- src/components/Link.tsx | 2 +- src/lib/strings/url-helpers.ts | 10 ++++++++-- 3 files changed, 15 insertions(+), 4 deletions(-) diff --git a/src/Navigation.tsx b/src/Navigation.tsx index 363875dcb6..06c5b2d6ca 100644 --- a/src/Navigation.tsx +++ b/src/Navigation.tsx @@ -481,7 +481,12 @@ const FlatNavigator = () => { const LINKING = { // TODO figure out what we are going to use - prefixes: ['bsky://', 'bluesky://', 'https://bsky.app'], + prefixes: [ + 'bsky://', + 'bluesky://', + 'https://bsky.app', + 'http://localhost:19006', + ], getPathFromState(state: State) { // find the current node in the navigation tree diff --git a/src/components/Link.tsx b/src/components/Link.tsx index 65a015ba3a..70142d6bab 100644 --- a/src/components/Link.tsx +++ b/src/components/Link.tsx @@ -127,7 +127,7 @@ export function useLink({ if ( shouldOpenInNewTab || - href.startsWith('http') || + // href.startsWith('http') || // TODO REVERT ME href.startsWith('mailto') ) { openLink(href) diff --git a/src/lib/strings/url-helpers.ts b/src/lib/strings/url-helpers.ts index 70a2b70692..da60f86f36 100644 --- a/src/lib/strings/url-helpers.ts +++ b/src/lib/strings/url-helpers.ts @@ -1,7 +1,8 @@ import {AtUri} from '@atproto/api' -import {BSKY_SERVICE} from 'lib/constants' -import TLDs from 'tlds' import psl from 'psl' +import TLDs from 'tlds' + +import {BSKY_SERVICE} from 'lib/constants' export const BSKY_APP_HOST = 'https://bsky.app' const BSKY_TRUSTED_HOSTS = [ @@ -98,6 +99,11 @@ export function isBskyRSSUrl(url: string): boolean { } export function isExternalUrl(url: string): boolean { + if (__DEV__ && url.startsWith('http://localhost:19006')) { + console.warn('REVERT ME') + return false + } + const external = !isBskyAppUrl(url) && url.startsWith('http') const rss = isBskyRSSUrl(url) return external || rss