Skip to content

Commit

Permalink
fix: fix details view if account with proposal gets deleted (#5739)
Browse files Browse the repository at this point in the history
Co-authored-by: Tuditi <45079109+Tuditi@users.noreply.github.com>
  • Loading branch information
MarkNerdi996 and Tuditi committed Feb 1, 2023
1 parent c5f064a commit 20e140e
Showing 1 changed file with 2 additions and 4 deletions.
@@ -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<boolean> {
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)
Expand Down

0 comments on commit 20e140e

Please sign in to comment.