Skip to content

Commit

Permalink
fix: icon display in connect modal
Browse files Browse the repository at this point in the history
  • Loading branch information
abretonc7s committed Mar 6, 2024
1 parent ba3e052 commit 4514277
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions app/components/Views/AccountConnect/AccountConnect.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,14 @@ const AccountConnect = (props: AccountConnectProps) => {
// Last wallet connect session metadata
const wc2Metadata = useSelector((state: RootState) => state.sdk.wc2Metadata);

const dappIconUrl = sdkConnection.originatorInfo?.icon;
const faviconSource = useFavicon(origin);

const actualIcon = useMemo(
() => ({ uri: dappIconUrl } ?? faviconSource),
[dappIconUrl, faviconSource],
);

const secureIcon = useMemo(
() =>
(getUrlObj(hostname) as URLParse<string>).protocol === 'https:'
Expand Down Expand Up @@ -363,7 +369,7 @@ const AccountConnect = (props: AccountConnectProps) => {
onUserAction={setUserIntent}
defaultSelectedAccount={defaultSelectedAccount}
isLoading={isLoading}
favicon={faviconSource}
favicon={actualIcon}
secureIcon={secureIcon}
urlWithProtocol={urlWithProtocol}
/>
Expand All @@ -375,7 +381,7 @@ const AccountConnect = (props: AccountConnectProps) => {
isLoading,
setScreen,
setSelectedAddresses,
faviconSource,
actualIcon,
secureIcon,
sdkConnection,
urlWithProtocol,
Expand Down

0 comments on commit 4514277

Please sign in to comment.