Skip to content

Commit

Permalink
fix: failed exec shows execute button
Browse files Browse the repository at this point in the history
  • Loading branch information
chalabi2 committed Jan 8, 2025
1 parent 12555f6 commit cd451c0
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions components/groups/modals/voteDetailsModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -435,13 +435,16 @@ function VoteDetailsModal({
const isClosed = proposal?.status === ('PROPOSAL_STATUS_CLOSED' as unknown as ProposalStatus);
const isProposer = proposal?.proposers?.includes(address ?? '');

if (isAccepted && isNotRun) {
if ((isAccepted && isNotRun) || isFailure) {
return { action: 'execute', label: 'Execute' };
} else if (isNotRun && proposalClosed && !isRejected) {
return { action: 'execute', label: 'Execute' };
} else if (!isClosed && !proposalClosed && !userHasVoted) {
return { action: 'vote', label: 'Vote' };
} else if (isRejected || isFailure || userHasVoted || (isProposer && !isNotRun)) {
} else if (
(!isAccepted && isProposer) ||
((isRejected || userHasVoted) && !isAccepted && !isNotRun)
) {
return { action: 'remove', label: 'Remove' };
}
return { action: null, label: null };
Expand Down

0 comments on commit cd451c0

Please sign in to comment.