Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: fix details view if account with proposal gets deleted #5739

Merged
merged 2 commits into from Feb 1, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
@@ -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