fixed tally issue

This commit is contained in:
liangping 2022-05-06 07:16:18 +08:00
parent 91cda46e9a
commit 7a3c64981c

View File

@ -260,18 +260,9 @@ export default {
updateTally(res) {
const voting = res.filter(i => i.status === 2)
if (voting.length > 0) {
let i = 0
Promise.all(voting.reverse().map(p => this.$http.getGovernanceTally(p.id, 0))).then(update => {
this.proposals.map(x => {
if (x.status === 2) {
const xh = x
xh.tally = update[i]
i += 1
return xh
}
return x
})
})
voting.forEach(p => this.$http.getGovernanceTally(p.id, 0).then(update => {
this.$set(p, 'tally', update)
}))
}
},
},