Filter assets before multi call (#10592)

This commit is contained in:
Tarik Gul 2024-05-17 14:49:25 -07:00 committed by GitHub
parent ad14047bfa
commit 51052fb3d6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -49,7 +49,7 @@ function useBalancesImpl (id?: BN | null): AccountResult[] | null {
const { api } = useApi();
const { allAccounts } = useAccounts();
const keys = useMemo(
() => [allAccounts.map((a) => [id, a])],
() => [allAccounts.map((a) => [id, a]).filter((tup) => !!tup[0])],
[allAccounts, id]
);
const query = useCall(keys && api.query.assets.account.multi, keys, OPTS);