Skip to content

Commit

Permalink
fix withdraw bug (solana-labs#2163)
Browse files Browse the repository at this point in the history
  • Loading branch information
abrzezinski94 authored Feb 25, 2024
1 parent 472c479 commit 8f8427e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,10 @@ const WithDrawCommunityTokens = () => {
)
).result
if (!governance) throw new Error('failed to fetch governance')
if (proposal.account.getTimeToVoteEnd(governance.account) > 0) {
if (
proposal.account.getTimeToVoteEnd(governance.account) > 0 &&
governance.account.realm.equals(realm!.pubkey)
) {
setIsLoading(false)
// Note: It's technically possible to withdraw the vote here but I think it would be confusing and people would end up unconsciously withdrawing their votes
notify({
Expand Down
5 changes: 4 additions & 1 deletion components/TokenBalance/VanillaWithdrawTokensButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,10 @@ const VanillaWithdrawTokensButton = ({
)
).result
if (!governance) throw new Error('failed to fetch governance')
if (proposal.account.getTimeToVoteEnd(governance.account) > 0) {
if (
proposal.account.getTimeToVoteEnd(governance.account) > 0 &&
governance.account.realm.equals(realm!.pubkey)
) {
// Note: It's technically possible to withdraw the vote here but I think it would be confusing and people would end up unconsciously withdrawing their votes
notify({
type: 'error',
Expand Down

0 comments on commit 8f8427e

Please sign in to comment.