From c612fca32a69ed5af769a7c5851598f35d14d1ee Mon Sep 17 00:00:00 2001 From: Hailey Date: Mon, 17 Mar 2025 15:06:26 -0700 Subject: remove .parse usage (#8016) * remove .parse usage * add one more usage --- src/lib/strings/url-helpers.ts | 2 +- src/view/com/modals/InAppBrowserConsent.tsx | 4 ++-- src/view/com/modals/LinkWarning.tsx | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/lib/strings/url-helpers.ts b/src/lib/strings/url-helpers.ts index df473b54e..20c3fabbc 100644 --- a/src/lib/strings/url-helpers.ts +++ b/src/lib/strings/url-helpers.ts @@ -323,7 +323,7 @@ export function createBskyAppAbsoluteUrl(path: string): string { export function createProxiedUrl(url: string): string { let u try { - u = URL.parse(url) + u = new URL(url) } catch { return url } diff --git a/src/view/com/modals/InAppBrowserConsent.tsx b/src/view/com/modals/InAppBrowserConsent.tsx index 105edfbc6..7178ff2f2 100644 --- a/src/view/com/modals/InAppBrowserConsent.tsx +++ b/src/view/com/modals/InAppBrowserConsent.tsx @@ -24,13 +24,13 @@ export function Component({href}: {href: string}) { const onUseIAB = React.useCallback(() => { setInAppBrowser(true) closeModal() - openLink(href, true) + openLink(href, true, true) }, [closeModal, setInAppBrowser, href, openLink]) const onUseLinking = React.useCallback(() => { setInAppBrowser(false) closeModal() - openLink(href, false) + openLink(href, false, true) }, [closeModal, setInAppBrowser, href, openLink]) return ( diff --git a/src/view/com/modals/LinkWarning.tsx b/src/view/com/modals/LinkWarning.tsx index dde4fee60..b0bf76ede 100644 --- a/src/view/com/modals/LinkWarning.tsx +++ b/src/view/com/modals/LinkWarning.tsx @@ -39,7 +39,7 @@ export function Component({ if (share) { shareUrl(href) } else { - openLink(href) + openLink(href, false, true) } } -- cgit 1.4.1