fix balances table when not connected

This commit is contained in:
saml33 2023-10-18 15:05:22 +11:00
parent 7f0ec51d97
commit e3756ac2a7
1 changed files with 4 additions and 2 deletions

View File

@ -47,7 +47,7 @@ const BalancesTable = () => {
const { initContributions } = useHealthContributions()
const filteredBanks = useMemo(() => {
if (banks.length) {
if (banks.length && mangoAccountAddress) {
return banks.filter((b) => {
return (
Math.abs(floorToDecimal(b.balance, b.bank.mintDecimals).toNumber()) >
@ -58,7 +58,7 @@ const BalancesTable = () => {
})
}
return []
}, [banks])
}, [banks, mangoAccountAddress])
const formattedTableData = useCallback(() => {
const formatted = []
@ -100,6 +100,8 @@ const BalancesTable = () => {
sortConfig,
} = useSortableData(formattedTableData())
console.log(tableData)
return filteredBanks.length ? (
showTableView ? (
<Table>