Skip to content

Commit

Permalink
fix: Dont reload balance when popup is toggled (#2987)
Browse files Browse the repository at this point in the history
  • Loading branch information
usame-algan authored Dec 8, 2023
1 parent 4f7e314 commit f162175
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/components/common/ConnectWallet/AccountCenter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ export const AccountCenter = ({ wallet }: { wallet: ConnectedWallet }) => {
transitionDuration={0}
>
<Paper className={css.popoverContainer}>
<WalletInfo wallet={wallet} handleClose={closeWalletInfo} />
<WalletInfo wallet={wallet} balance={balance} handleClose={closeWalletInfo} />
</Paper>
</Popover>
</>
Expand Down
5 changes: 3 additions & 2 deletions src/components/common/WalletInfo/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import WalletBalance from '@/components/common/WalletBalance'
import { WalletIdenticon } from '@/components/common/WalletOverview'
import useWalletBalance from '@/hooks/wallets/useWalletBalance'
import { type BigNumber } from 'ethers'
import { Box, Button, Typography } from '@mui/material'
import css from './styles.module.css'
import SocialLoginInfo from '@/components/common/SocialLoginInfo'
Expand All @@ -22,6 +22,7 @@ import PowerSettingsNewIcon from '@mui/icons-material/PowerSettingsNew'

type WalletInfoProps = {
wallet: ConnectedWallet
balance: BigNumber | undefined
socialWalletService: ReturnType<typeof useSocialWallet>
router: ReturnType<typeof useRouter>
onboard: ReturnType<typeof useOnboard>
Expand All @@ -31,6 +32,7 @@ type WalletInfoProps = {

export const WalletInfo = ({
wallet,
balance,
socialWalletService,
router,
onboard,
Expand All @@ -39,7 +41,6 @@ export const WalletInfo = ({
}: WalletInfoProps) => {
const chainInfo = useAppSelector((state) => selectChainById(state, wallet.chainId))
const prefix = chainInfo?.shortName
const [balance] = useWalletBalance()

const handleSwitchWallet = () => {
if (onboard) {
Expand Down

0 comments on commit f162175

Please sign in to comment.