diff --git a/packages/shared/lib/contexts/governance/utils/isAnyAccountVotingForSelectedProposal.ts b/packages/shared/lib/contexts/governance/utils/isAnyAccountVotingForSelectedProposal.ts index 442d3d2409..858d179a47 100644 --- a/packages/shared/lib/contexts/governance/utils/isAnyAccountVotingForSelectedProposal.ts +++ b/packages/shared/lib/contexts/governance/utils/isAnyAccountVotingForSelectedProposal.ts @@ -1,11 +1,9 @@ -import { activeProfile } from '@core/profile' +import { activeAccounts } from '@core/profile' import { get } from 'svelte/store' import { isVotingForSelectedProposal } from './isVotingForSelectedProposal' export async function isAnyAccountVotingForSelectedProposal(): Promise { - const accountIndexes = Object.values(get(activeProfile)?.accountMetadata).map( - (accountMetadata) => accountMetadata.index - ) + const accountIndexes = get(activeAccounts).map((account) => account.index) const isVotingPromises = accountIndexes.map(isVotingForSelectedProposal) const results = await Promise.all(isVotingPromises) return results.some((bool) => bool === true)