From c199533f59f63c028176854161f0cd2e028d117e Mon Sep 17 00:00:00 2001 From: Aaron Cook Date: Tue, 17 Oct 2023 15:18:14 +0200 Subject: [PATCH] fix: session management when switching chains (#2640) * fix: session management when switching chains * fix: move function to private method * fix: enable header, grey out sessions + don't add chains --- .../walletconnect/HeaderWidget/Icon.tsx | 4 +- .../walletconnect/SessionList/index.tsx | 8 +- .../SuccessBanner/styles.module.css | 1 + .../walletconnect/WcInput/index.tsx | 4 +- .../walletconnect/WalletConnectWallet.ts | 77 +++++++++++-------- 5 files changed, 56 insertions(+), 38 deletions(-) diff --git a/src/components/walletconnect/HeaderWidget/Icon.tsx b/src/components/walletconnect/HeaderWidget/Icon.tsx index c2b8c7915e..6cd660788d 100644 --- a/src/components/walletconnect/HeaderWidget/Icon.tsx +++ b/src/components/walletconnect/HeaderWidget/Icon.tsx @@ -12,8 +12,8 @@ type IconProps = { } } -const Icon = ({ sessionCount, sessionInfo, ...props }: IconProps): React.ReactElement => ( - +const Icon = ({ sessionCount, sessionInfo, onClick }: IconProps): React.ReactElement => ( + 1 diff --git a/src/components/walletconnect/SessionList/index.tsx b/src/components/walletconnect/SessionList/index.tsx index 8278f95fff..16a4d45344 100644 --- a/src/components/walletconnect/SessionList/index.tsx +++ b/src/components/walletconnect/SessionList/index.tsx @@ -1,4 +1,5 @@ import SafeAppIconCard from '@/components/safe-apps/SafeAppIconCard' +import useSafeInfo from '@/hooks/useSafeInfo' import { Button, List, ListItem, ListItemAvatar, ListItemIcon, ListItemText, Typography } from '@mui/material' import type { SessionTypes } from '@walletconnect/types' import type { ReactElement } from 'react' @@ -17,6 +18,8 @@ const SessionListItem = ({ session: SessionTypes.Struct onDisconnect: () => void }): ReactElement => { + const { safeLoaded } = useSafeInfo() + return ( {session.peer.metadata.icons[0] && ( @@ -24,7 +27,10 @@ const SessionListItem = ({ )} - +