Fixed issue: adding duplicated blocks to chart

This commit is contained in:
liangping 2022-04-12 09:27:11 +08:00
parent 9a930ee1aa
commit a9fb8c31ef
2 changed files with 2 additions and 2 deletions

View File

@ -235,7 +235,7 @@ export default {
res.block.last_commit.signatures.forEach(x => { res.block.last_commit.signatures.forEach(x => {
if (x.validator_address) sigs[x.validator_address] = 'bg-success' if (x.validator_address) sigs[x.validator_address] = 'bg-success'
}) })
const block = this.blocks.find(b => b[1] === res.block.last_commit.height) const block = this.blocks.find(b => b.height === res.block.last_commit.height)
if (typeof block === 'undefined') { // mei if (typeof block === 'undefined') { // mei
// this.$set(block, 0, typeof sigs !== 'undefined') // this.$set(block, 0, typeof sigs !== 'undefined')
if (this.blocks.length >= 50) this.blocks.shift() if (this.blocks.length >= 50) this.blocks.shift()

View File

@ -209,7 +209,7 @@ export default {
if (x.validator_address) sigs[x.validator_address] = 'bg-success' if (x.validator_address) sigs[x.validator_address] = 'bg-success'
}) })
this.height = res.block.last_commit.height this.height = res.block.last_commit.height
const block = this.blocks.find(b => b[1] === res.block.last_commit.height) const block = this.blocks.find(b => b.height === res.block.last_commit.height)
if (typeof block === 'undefined') { // mei if (typeof block === 'undefined') { // mei
// this.$set(block, 0, typeof sigs !== 'undefined') // this.$set(block, 0, typeof sigs !== 'undefined')
if (this.blocks.length >= 50) this.blocks.shift() if (this.blocks.length >= 50) this.blocks.shift()