Skip to content

Commit

Permalink
Fix blockHeight -1 bug and undefined translations
Browse files Browse the repository at this point in the history
  • Loading branch information
Duddino committed Jan 13, 2025
1 parent 4bc0618 commit 26b73d7
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
13 changes: 8 additions & 5 deletions scripts/governance/Governance.vue
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ watch(
[blockCount, localProposals],
async () => {
for (const proposal of localProposals.value) {
if (!proposal.blockHeight) {
if (!proposal.blockHeight || proposal.blockHeight === -1) {
let tx;
try {
tx = await getNetwork().getTxInfo(proposal.txid);
Expand All @@ -74,8 +74,7 @@ watch(
cChainParams.current.proposalFeeConfirmRequirement
) {
// Proposal fee has the required amounts of confirms, stop watching and try to finalize
// TODO: remove propsal
finalizeProposal(proposal);
await finalizeProposal(proposal);
}
}
},
Expand Down Expand Up @@ -188,12 +187,16 @@ async function createProposal(name, url, payments, monthlyPayment, address) {
}
async function finalizeProposal(proposal) {
const { ok, err } = await Masternode.finalizeProposal(proposal);
if (ok) {
createAlert('success', translation.PROPOSAL_FINALISED);
createAlert('success', ALERTS.PROPOSAL_FINALISED);
localProposals.value = localProposals.value.filter(
(p) => p.txid !== proposal.txid
);
} else {
createAlert(
'warning',
translation.PROPOSAL_FINALISE_FAIL + '<br>' + sanitizeHTML(err)
ALERTS.PROPOSAL_FINALISE_FAIL + '<br>' + sanitizeHTML(err)
);
}
}
Expand Down
2 changes: 1 addition & 1 deletion scripts/governance/LocalProposalStatus.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const props = defineProps({
const { proposal, blockCount } = toRefs(props);
const status = computed(() => {
if (!proposal.value.blockHeight) {
if (!proposal.value.blockHeight || proposal.value.blockHeight === -1) {
// If we have no blockHeight, proposal fee is still confirming
return translation.proposalFinalisationConfirming;
}
Expand Down

0 comments on commit 26b73d7

Please sign in to comment.