From a0bf003f843732adc2323a34d2abb821cefc45ab Mon Sep 17 00:00:00 2001 From: Skylar Barrera Date: Wed, 4 Oct 2023 15:42:34 -0400 Subject: [PATCH] links: fix profiles (#5088) --- src/handlers/deeplinks.ts | 2 +- src/hooks/useScanner.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/handlers/deeplinks.ts b/src/handlers/deeplinks.ts index d7bff1130b3..cd60a07873b 100644 --- a/src/handlers/deeplinks.ts +++ b/src/handlers/deeplinks.ts @@ -199,7 +199,7 @@ export default async function handleDeeplink( } default: { - const addressOrENS = pathname?.split('/')?.[1]; + const addressOrENS = pathname?.split('/profile/')?.[1]; /** * This handles ENS profile links on mobile i.e. diff --git a/src/hooks/useScanner.ts b/src/hooks/useScanner.ts index 0324ca4e528..68fe45c436b 100644 --- a/src/hooks/useScanner.ts +++ b/src/hooks/useScanner.ts @@ -89,7 +89,7 @@ export default function useScanner(enabled: boolean, onSuccess: () => unknown) { analytics.track('Scanned Rainbow profile url'); const urlObj = new URL(url); - const addressOrENS = urlObj.pathname?.split('/')?.[1] || ''; + const addressOrENS = urlObj.pathname?.split('/profile/')?.[1] || ''; const isValid = await checkIsValidAddressOrDomain(addressOrENS); if (isValid) { const ensName = isENSAddressFormat(addressOrENS)