From 30e8a354bc888a6898f6f09cfcb9eeb4bde14fbb Mon Sep 17 00:00:00 2001 From: liangping <18786721@qq.com> Date: Tue, 1 Nov 2022 20:16:33 +0800 Subject: [PATCH] update tally for ongoing proposals --- src/views/Governance.vue | 14 ++++++++------ src/views/GovernanceProposalView.vue | 4 +++- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/src/views/Governance.vue b/src/views/Governance.vue index f52b72a9..e0b83a96 100644 --- a/src/views/Governance.vue +++ b/src/views/Governance.vue @@ -80,12 +80,14 @@ export default { }) }, updateTally(res) { - const voting = res.filter(i => i.status === 2) - if (voting.length > 0) { - voting.forEach(p => this.$http.getGovernanceTally(p.id, 0).then(update => { - this.$set(p, 'tally', update) - })) - } + this.$http.getStakingPool().then(pool => { + const voting = res.filter(i => i.status === 2) + if (voting.length > 0) { + voting.forEach(p => this.$http.getGovernanceTally(p.id, pool.bondedToken).then(update => { + this.$set(p, 'tally', update) + })) + } + }) }, }, } diff --git a/src/views/GovernanceProposalView.vue b/src/views/GovernanceProposalView.vue index bea06b2c..e407f8da 100644 --- a/src/views/GovernanceProposalView.vue +++ b/src/views/GovernanceProposalView.vue @@ -367,7 +367,9 @@ export default { this.$http.getGovernance(pid).then(p => { if (p.status === 2) { - this.$http.getGovernanceTally(pid, 0).then(t => p.updateTally(t)) + this.$http.getStakingPool().then(pool => { + this.$http.getGovernanceTally(pid, pool.bondedToken).then(t => p.updateTally(t)) + }) } this.proposal = p })