Skip to content

Commit

Permalink
fix: check base account for delegate from PV (#2553)
Browse files Browse the repository at this point in the history
  • Loading branch information
Asmadek authored Oct 30, 2024
1 parent 3709f78 commit 5f38de3
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,12 @@ const $isAddAvailable = combine(
({ canDelegate, activeAccounts, activeWallet, chain }) => {
if (!chain || !activeWallet) return false;

const accounts = activeWallet?.accounts.filter((account) => accountUtils.isChainAndCryptoMatch(account, chain));
const accounts = activeWallet?.accounts.filter((account) => {
const isChainAndCryptoMatch = accountUtils.isChainAndCryptoMatch(account, chain);
const isNonBaseVaultAccount = accountUtils.isNonBaseVaultAccount(account, activeWallet);

return isChainAndCryptoMatch && isNonBaseVaultAccount;
});

const freeAccounts = accounts.filter(
(account) => !activeAccounts.includes(toAddress(account.accountId, { prefix: chain.addressPrefix })),
Expand Down

0 comments on commit 5f38de3

Please sign in to comment.