From db0055578d90aa81d4383d2ff85305e51960f200 Mon Sep 17 00:00:00 2001 From: EtherWizard33 Date: Wed, 4 Dec 2024 19:21:37 -0500 Subject: [PATCH 1/2] fix: when sdk url was unknown, this caused a bug, this is now fixed --- .../Views/AccountConnect/AccountConnect.tsx | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/app/components/Views/AccountConnect/AccountConnect.tsx b/app/components/Views/AccountConnect/AccountConnect.tsx index 714386ed03e..44449f37da3 100644 --- a/app/components/Views/AccountConnect/AccountConnect.tsx +++ b/app/components/Views/AccountConnect/AccountConnect.tsx @@ -159,6 +159,8 @@ const AccountConnect = (props: AccountConnectProps) => { const dappIconUrl = sdkConnection?.originatorInfo?.icon; const dappUrl = sdkConnection?.originatorInfo?.url ?? ''; + const [isSdkUrlUnknown, setIsSdkUrlUnknown] = useState(false); + const { domainTitle, hostname } = useMemo(() => { let title = ''; let dappHostname = dappUrl || channelIdOrHostname; @@ -178,6 +180,7 @@ const AccountConnect = (props: AccountConnectProps) => { dappHostname = inappBrowserOrigin; } else { title = strings('sdk.unknown'); + setIsSdkUrlUnknown(true); } return { domainTitle: title, hostname: dappHostname }; @@ -357,7 +360,13 @@ const AccountConnect = (props: AccountConnectProps) => { .build(), ); }, - [accountsLength, channelIdOrHostname, trackEvent, createEventBuilder, eventSource], + [ + accountsLength, + channelIdOrHostname, + trackEvent, + createEventBuilder, + eventSource, + ], ); const navigateToUrlInEthPhishingModal = useCallback( @@ -799,7 +808,9 @@ const AccountConnect = (props: AccountConnectProps) => { const renderConnectScreens = useCallback(() => { switch (screen) { case AccountConnectScreens.SingleConnect: - return isMultichainVersion1Enabled + return isSdkUrlUnknown + ? renderSingleConnectScreen() + : isMultichainVersion1Enabled ? renderPermissionsSummaryScreen() : renderSingleConnectScreen(); case AccountConnectScreens.SingleConnectSelector: @@ -811,6 +822,8 @@ const AccountConnect = (props: AccountConnectProps) => { } }, [ screen, + isSdkUrlUnknown, + isMultichainVersion1Enabled, renderSingleConnectScreen, renderPermissionsSummaryScreen, renderSingleConnectSelectorScreen, From 6b43eb0144a5d724ea48b2e9c2d18126fc4351df Mon Sep 17 00:00:00 2001 From: EtherWizard33 Date: Wed, 4 Dec 2024 19:23:45 -0500 Subject: [PATCH 2/2] style: lint --- app/components/Views/AccountConnect/AccountConnect.tsx | 1 - 1 file changed, 1 deletion(-) diff --git a/app/components/Views/AccountConnect/AccountConnect.tsx b/app/components/Views/AccountConnect/AccountConnect.tsx index 44449f37da3..a7fa98c770f 100644 --- a/app/components/Views/AccountConnect/AccountConnect.tsx +++ b/app/components/Views/AccountConnect/AccountConnect.tsx @@ -823,7 +823,6 @@ const AccountConnect = (props: AccountConnectProps) => { }, [ screen, isSdkUrlUnknown, - isMultichainVersion1Enabled, renderSingleConnectScreen, renderPermissionsSummaryScreen, renderSingleConnectSelectorScreen,