Skip to content

Commit d21ba5b

Browse files
authored
chore: update noAsset condition for walletModal (#11739)
<!-- Before opening a pull request, please read the [contributing guidelines](https://github.com/pancakeswap/pancake-frontend/blob/develop/CONTRIBUTING.md) first --> <!-- start pr-codex --> --- ## PR-Codex overview This PR updates the logic for determining if there are no assets in the `WalletModal` component by including a check for `totalBalanceUsd`. This enhances the condition to account for cases where the total balance is zero. ### Detailed summary - Modified the `noAssets` constant to check if either `topTokens.length` is zero or `totalBalanceUsd` is zero, in addition to the existing `!isLoading` condition. > ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your question}` <!-- end pr-codex -->
1 parent 5c0301b commit d21ba5b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

apps/web/src/components/WalletModalV2/WalletModal.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ export const WalletContent = ({
225225

226226
// Get top tokens by value
227227
const topTokens = balances
228-
const noAssets = topTokens.length === 0 && !isLoading
228+
const noAssets = (topTokens.length === 0 || totalBalanceUsd === 0) && !isLoading
229229
const handleClick = useCallback((newIndex: number) => {
230230
setView(newIndex)
231231
}, [])

0 commit comments

Comments
 (0)