@@ -5,7 +5,6 @@ import { getCurrentChainIdFromUrl, getRawCurrentChainIdFromUrl, logSafeApi } fro
55import { getSafeInfo , normalizeSafeError , SAFE_RATE_LIMIT_MSG } from '@cowprotocol/core'
66import { SupportedChainId } from '@cowprotocol/cow-sdk'
77import { AccountType } from '@cowprotocol/types'
8- import { useWalletProvider } from '@cowprotocol/wallet-provider'
98import type { SafeInfoResponse } from '@safe-global/api-kit'
109import type { SafeInfoExtended } from '@safe-global/safe-apps-sdk'
1110
@@ -46,8 +45,7 @@ function useBrowserUrlKey(): string {
4645function useWalletInfo ( ) : WalletInfo {
4746 // TODO: Replace urlKey with locationNetworkAtom, which will also trigger the useMemo below less often.
4847 const urlKey = useBrowserUrlKey ( )
49- const { address, chainId, isConnected, status, connector } = useAccountState ( )
50- const isConnectionRestoring = status === 'reconnecting'
48+ const { address, chainId, isConnected, connector } = useAccountState ( )
5149 const isChainIdUnsupported = ! ! chainId && ! ( chainId in SupportedChainId )
5250 const [ lastStableChainId , setLastStableChainId ] = useState < SupportedChainId | undefined > ( undefined )
5351 const [ lastResolvedChainId , setLastResolvedChainId ] = useState < SupportedChainId > ( ( ) => getCurrentChainIdFromUrl ( ) )
@@ -83,19 +81,8 @@ function useWalletInfo(): WalletInfo {
8381 active : isConnected ,
8482 account : address ,
8583 connector,
86- isConnectionRestoring,
8784 }
88- } , [
89- address ,
90- chainId ,
91- isConnected ,
92- connector ,
93- isChainIdUnsupported ,
94- isConnectionRestoring ,
95- lastStableChainId ,
96- lastResolvedChainId ,
97- urlKey ,
98- ] )
85+ } , [ address , chainId , isConnected , connector , isChainIdUnsupported , lastStableChainId , lastResolvedChainId , urlKey ] )
9986
10087 useEffect ( ( ) => {
10188 setLastResolvedChainId ( walletInfo . chainId )
@@ -140,7 +127,7 @@ let shortSafeInfoInterval: ReturnType<typeof setInterval> | null = null
140127let longSafeInfoInterval : ReturnType < typeof setInterval > | null = null
141128
142129export function WalletUpdater ( ) : null {
143- const { chainId, active, account, connector, isConnectionRestoring } = useWalletInfo ( )
130+ const { chainId, active, account, connector } = useWalletInfo ( )
144131
145132 const walletDetails = useWalletDetails ( account )
146133 const gnosisSafeInfo = useSafeInfo ( )
@@ -149,11 +136,9 @@ export function WalletUpdater(): null {
149136 const setWalletDetails = useSetAtom ( walletDetailsAtom )
150137 const setGnosisSafeInfo = useSetAtom ( gnosisSafeInfoAtom )
151138
152- const provider = useWalletProvider ( )
153-
154139 useEffect ( ( ) => {
155- setWalletInfo ( { chainId, active, account, connector, isConnectionRestoring , provider } )
156- } , [ chainId , active , account , connector , isConnectionRestoring , provider , setWalletInfo ] )
140+ setWalletInfo ( { chainId, active, account, connector } )
141+ } , [ chainId , active , account , connector , setWalletInfo ] )
157142
158143 useEffect ( ( ) => {
159144 const walletType = getWalletType ( { gnosisSafeInfo, isSmartContractWallet : walletDetails . isSmartContractWallet } )
0 commit comments