Skip to content

Commit 4bf7632

Browse files
authored
handle veto votes in relinquishment (#203)
1 parent 74b084a commit 4bf7632

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

VoteStakeRegistry/components/TokenBalance/WithdrawCommunityTokensBtn.tsx

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,10 +83,24 @@ const WithDrawCommunityTokens = () => {
8383
})
8484
const proposal = proposalQuery.result
8585

86-
if (!proposal || !ownTokenRecord || !proposal.account.governingTokenMint.equals(ownTokenRecord.account.governingTokenMint)) {
86+
if (!proposal || !ownTokenRecord) {
8787
continue
8888
}
8989

90+
if (voteRecord.account.vote?.veto) {
91+
const vetoMint = realm?.account.config.councilMint
92+
if (
93+
vetoMint &&
94+
!proposal.account.governingTokenMint.equals(vetoMint)
95+
) {
96+
continue
97+
}
98+
} else {
99+
if (!proposal.account.governingTokenMint.equals(ownTokenRecord.account.governingTokenMint)) {
100+
continue
101+
}
102+
}
103+
90104
if (proposal.account.state === ProposalState.Voting) {
91105
// If the Proposal is in Voting state refetch it to make sure we have the latest state to avoid false positives
92106
if (proposal.account.state === ProposalState.Voting) {

0 commit comments

Comments
 (0)