diff --git a/dapps/react-dapp-v2/src/App.tsx b/dapps/react-dapp-v2/src/App.tsx index 4e2c32d..c358a9b 100644 --- a/dapps/react-dapp-v2/src/App.tsx +++ b/dapps/react-dapp-v2/src/App.tsx @@ -44,7 +44,7 @@ export default function App() { chains, accounts, balances, - fetching, + isFetchingBalances, isInitializing, setChains, } = useWalletConnectClient(); @@ -179,7 +179,7 @@ export default function App() { active={chains.includes(chainId)} /> ))} - + {"Connect"} @@ -196,7 +196,7 @@ export default function App() { key={account} active={true} chainData={chainData} - fetching={fetching} + fetching={isFetchingBalances} address={address} chainId={chainId} balances={balances} diff --git a/dapps/react-dapp-v2/src/contexts/ClientContext.tsx b/dapps/react-dapp-v2/src/contexts/ClientContext.tsx index 0876e74..202449e 100644 --- a/dapps/react-dapp-v2/src/contexts/ClientContext.tsx +++ b/dapps/react-dapp-v2/src/contexts/ClientContext.tsx @@ -30,11 +30,11 @@ interface IContext { connect: (pairing?: { topic: string }) => Promise; disconnect: () => Promise; isInitializing: boolean; - fetching: boolean; chains: string[]; pairings: string[]; accounts: string[]; balances: AccountBalances; + isFetchingBalances: boolean; setChains: any; } @@ -51,7 +51,7 @@ export function ClientContextProvider({ children }: { children: ReactNode | Reac const [pairings, setPairings] = useState([]); const [session, setSession] = useState(); - const [fetching, setFetching] = useState(false); + const [isFetchingBalances, setIsFetchingBalances] = useState(false); const [isInitializing, setIsInitializing] = useState(false); const [balances, setBalances] = useState({}); @@ -67,7 +67,7 @@ export function ClientContextProvider({ children }: { children: ReactNode | Reac }; const getAccountBalances = async (_accounts: string[]) => { - setFetching(true); + setIsFetchingBalances(true); try { const arr = await Promise.all( _accounts.map(async account => { @@ -86,7 +86,7 @@ export function ClientContextProvider({ children }: { children: ReactNode | Reac } catch (e) { console.error(e); } finally { - setFetching(false); + setIsFetchingBalances(false); } }; @@ -249,9 +249,9 @@ export function ClientContextProvider({ children }: { children: ReactNode | Reac const value = useMemo( () => ({ pairings, - fetching, isInitializing, balances, + isFetchingBalances, accounts, chains, client, @@ -262,9 +262,9 @@ export function ClientContextProvider({ children }: { children: ReactNode | Reac }), [ pairings, - fetching, isInitializing, balances, + isFetchingBalances, accounts, chains, client,