Skip to content

Commit

Permalink
My Voting Result was wrong! (#4585)
Browse files Browse the repository at this point in the history
* My Voting Result was wrong!

* yarn lint:fix
  • Loading branch information
akiowebstar authored Oct 24, 2023
1 parent 659ca01 commit 3bae157
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import React, { useMemo, useState } from 'react'
import { useMyAccounts } from '@/accounts/hooks/useMyAccounts'
import { Account } from '@/accounts/types'
import { TabProps, Tabs } from '@/common/components/Tabs'
import { sumStakes } from '@/common/utils/bn'
import { CandidateVoteList } from '@/council/components/election/CandidateVote/CandidateVoteList'
import { electionVotingResultComparator } from '@/council/model/electionVotingResultComparator'
import { ElectionVotingResult, PastElectionWithDetails } from '@/council/types/PastElection'
Expand Down Expand Up @@ -52,6 +53,9 @@ export const PastElectionTabs = ({ election }: PastElectionTabsProps) => {
<CandidateVoteList
votes={votingResults.map((votingResult, index) => {
const myVote = getMyVote(votingResult, allAccounts)
const myVotesTmp = votingResult.votes.filter((vote) =>
allAccounts.some((otherObj) => otherObj.address === vote.castBy)
)

return {
candidateId: votingResult.candidate.id,
Expand All @@ -62,7 +66,7 @@ export const PastElectionTabs = ({ election }: PastElectionTabsProps) => {
votes: votingResult.votes.length,
index: index + 1,
myVotes: [],
myStake: myVote?.stake,
myStake: sumStakes(myVotesTmp),
}
})}
/>
Expand Down

2 comments on commit 3bae157

@vercel
Copy link

@vercel vercel bot commented on 3bae157 Oct 24, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vercel
Copy link

@vercel vercel bot commented on 3bae157 Oct 24, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

pioneer-2 – ./

pioneer-2.vercel.app
pioneer-2-joystream.vercel.app
pioneer-2-git-dev-joystream.vercel.app

Please sign in to comment.