Skip to content

Commit

Permalink
Improve Proposal Status logic
Browse files Browse the repository at this point in the history
  • Loading branch information
JSKitty committed Sep 17, 2023
1 parent ccad904 commit 497263d
Showing 1 changed file with 10 additions and 11 deletions.
21 changes: 10 additions & 11 deletions scripts/global.js
Expand Up @@ -2234,19 +2234,18 @@ async function renderProposals(arrProposals, fContested) {
let strFundingStatus = '';

// Proposal Status calculations
if (cProposal.IsEstablished) {
// Scenario 1: Proposal is established and is or is not funded
if (nNetYes >= nRequiredVotes) {
strStatus = translation.proposalPassing;
strFundingStatus = translation.proposalFunded;
} else {
strStatus = translation.proposalFailing;
strFundingStatus = translation.proposalNotFunded;
}
} else {
// Scenario 2: Proposal is not established (nor funded)
if (nNetYes < nRequiredVotes) {
// Scenario 1: Not enough votes
strStatus = translation.proposalFailing;
strFundingStatus = translation.proposalNotFunded;
} else if (!cProposal.IsEstablished) {
// Scenario 2: Enough votes, but not established
strStatus = translation.proposalFailing;
strFundingStatus = translation.proposalTooYoung;
} else {
// Scenario 3: Enough votes, and established
strStatus = translation.proposalPassing;
strFundingStatus = translation.proposalFunded;
}

// Funding Status and allocation calculations
Expand Down

0 comments on commit 497263d

Please sign in to comment.