Skip to content

Commit

Permalink
fix: falsy loading state
Browse files Browse the repository at this point in the history
  • Loading branch information
foodaka committed Dec 12, 2024
1 parent 368a43c commit 9a9bba3
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
10 changes: 5 additions & 5 deletions src/components/WalletConnection/ReadOnlyModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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]);

Expand All @@ -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
Expand All @@ -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);
Expand All @@ -109,11 +109,11 @@ export const ReadOnlyModal = () => {
return (
<BasicModal open={type === ModalType.ReadMode} setOpen={close}>
<Box sx={{ display: 'flex', flexDirection: 'column' }}>
<TxModalTitle title="Connect a wallet" />
<TxModalTitle title="Watch Wallet" />
{error && <Warning severity="error">{handleBlocking()}</Warning>}
<Box sx={{ display: 'flex', alignItems: 'center', mb: 1, padding: '10px 0' }}>
<Typography variant="subheader1" color="text.secondary">
<Trans>Track wallet balance in read-only mode</Trans>
<Trans>Watch a wallet balance in read-only mode</Trans>
</Typography>
<ReadOnlyModeTooltip />
</Box>
Expand Down
2 changes: 1 addition & 1 deletion src/layouts/SettingsMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ export function SettingsMenu() {
<LanguageListItem onClick={handleLanguageClick} component={MenuItem} />
<MenuItem onClick={handleOpenReadMode}>
<ListItemText>
<Trans>Read mode</Trans>
<Trans>Watch wallet</Trans>
</ListItemText>
</MenuItem>
</Menu>
Expand Down
4 changes: 2 additions & 2 deletions src/libs/web3-data-provider/Web3Provider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 });

Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit 9a9bba3

Please sign in to comment.