Skip to content

Commit

Permalink
remove duplicate useEffect block
Browse files Browse the repository at this point in the history
  • Loading branch information
cryptominnow committed Dec 4, 2021
1 parent 5b1d92a commit 1afc290
Showing 1 changed file with 0 additions and 9 deletions.
9 changes: 0 additions & 9 deletions hooks/useWalletBalance.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,6 @@ export const WalletBalanceProvider: React.FC<{}> = ({ children }) => {
})();
}, [wallet, connection]);

useEffect(() => {
(async () => {
if (wallet?.publicKey) {
const balance = await connection.getBalance(wallet.publicKey);
setBalance(balance / LAMPORTS_PER_SOL);
}
})();
}, [wallet, connection]);

return (
<BalanceContext.Provider value={[balance, setBalance] as any}>
{children}
Expand Down

0 comments on commit 1afc290

Please sign in to comment.