From 9a9bba325a01a2563df836cca35f1df04c65b6f6 Mon Sep 17 00:00:00 2001 From: Mark Hinschberger Date: Thu, 12 Dec 2024 17:37:55 +0000 Subject: [PATCH] fix: falsy loading state --- src/components/WalletConnection/ReadOnlyModal.tsx | 10 +++++----- src/layouts/SettingsMenu.tsx | 2 +- src/libs/web3-data-provider/Web3Provider.tsx | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/components/WalletConnection/ReadOnlyModal.tsx b/src/components/WalletConnection/ReadOnlyModal.tsx index 394af88939..28325b6492 100644 --- a/src/components/WalletConnection/ReadOnlyModal.tsx +++ b/src/components/WalletConnection/ReadOnlyModal.tsx @@ -59,7 +59,7 @@ export const ReadOnlyModal = () => { useEffect(() => { const readOnlyAddress = localStorage.getItem('readOnlyModeAddress'); if (readOnlyAddress) { - connect({ connector: mock({ accounts: [ readOnlyAddress as `0x${string}` ] }) }); + connect({ connector: mock({ accounts: [readOnlyAddress as `0x${string}`] }) }); } }, [connect]); @@ -81,7 +81,7 @@ export const ReadOnlyModal = () => { if (validAddressError) setValidAddressError(false); if (utils.isAddress(inputMockWalletAddress)) { localStorage.setItem('readOnlyModeAddress', inputMockWalletAddress); - connect({ connector: mock({ accounts: [ inputMockWalletAddress as `0x${string}` ] }) }); + connect({ connector: mock({ accounts: [inputMockWalletAddress as `0x${string}`] }) }); close(); } else { // Check if address could be valid ENS before trying to resolve @@ -90,7 +90,7 @@ export const ReadOnlyModal = () => { const resolvedAddress = await mainnetProvider.resolveName(inputMockWalletAddress); if (resolvedAddress && utils.isAddress(resolvedAddress)) { localStorage.setItem('readOnlyModeAddress', inputMockWalletAddress); - connect({ connector: mock({ accounts: [ inputMockWalletAddress as `0x${string}` ] }) }); + connect({ connector: mock({ accounts: [inputMockWalletAddress as `0x${string}`] }) }); close(); } else { setValidAddressError(true); @@ -109,11 +109,11 @@ export const ReadOnlyModal = () => { return ( - + {error && {handleBlocking()}} - Track wallet balance in read-only mode + Watch a wallet balance in read-only mode diff --git a/src/layouts/SettingsMenu.tsx b/src/layouts/SettingsMenu.tsx index 41cc13bed9..151c16d824 100644 --- a/src/layouts/SettingsMenu.tsx +++ b/src/layouts/SettingsMenu.tsx @@ -99,7 +99,7 @@ export function SettingsMenu() { - Read mode + Watch wallet diff --git a/src/libs/web3-data-provider/Web3Provider.tsx b/src/libs/web3-data-provider/Web3Provider.tsx index 9298c47b54..2a1d802ecc 100644 --- a/src/libs/web3-data-provider/Web3Provider.tsx +++ b/src/libs/web3-data-provider/Web3Provider.tsx @@ -47,7 +47,7 @@ export const Web3ContextProvider: React.FC<{ children: ReactElement }> = ({ chil // const { chainId: chainId, connector, provider, isActivating, isActive } = useWeb3React(); const { switchChainAsync } = useSwitchChain(); const { watchAssetAsync } = useWatchAsset(); - const { chainId, address, isConnected, isConnecting, connector } = useAccount(); + const { chainId, address, isConnected, connector } = useAccount(); const client = useClient({ chainId }); const { data: connectorClient } = useConnectorClient({ chainId }); @@ -252,7 +252,7 @@ export const Web3ContextProvider: React.FC<{ children: ReactElement }> = ({ chil value={{ web3ProviderData: { connected: isConnected, - loading: isConnecting, + loading: false, chainId: chainId || 1, switchNetwork, getTxError,