From 5f38de3379d50e5288439cb4abf79fe1a66d5a5b Mon Sep 17 00:00:00 2001 From: Aleksandr Makhnev Date: Wed, 30 Oct 2024 17:54:13 +0500 Subject: [PATCH] fix: check base account for delegate from PV (#2553) --- .../DelegateDetails/model/delegate-details-model.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/renderer/widgets/DelegateDetails/model/delegate-details-model.ts b/src/renderer/widgets/DelegateDetails/model/delegate-details-model.ts index b2cb56271c..577c6e2656 100644 --- a/src/renderer/widgets/DelegateDetails/model/delegate-details-model.ts +++ b/src/renderer/widgets/DelegateDetails/model/delegate-details-model.ts @@ -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 })),