From a9fb8c31efbaf249208ef6470655db6517468b4e Mon Sep 17 00:00:00 2001 From: liangping <18786721@qq.com> Date: Tue, 12 Apr 2022 09:27:11 +0800 Subject: [PATCH] Fixed issue: adding duplicated blocks to chart --- src/views/Uptime.vue | 2 +- src/views/UptimeMyChainBlocks.vue | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/views/Uptime.vue b/src/views/Uptime.vue index 188b4b9b..3c00e216 100644 --- a/src/views/Uptime.vue +++ b/src/views/Uptime.vue @@ -235,7 +235,7 @@ export default { res.block.last_commit.signatures.forEach(x => { 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 // this.$set(block, 0, typeof sigs !== 'undefined') if (this.blocks.length >= 50) this.blocks.shift() diff --git a/src/views/UptimeMyChainBlocks.vue b/src/views/UptimeMyChainBlocks.vue index 7abcb12d..45ad2786 100644 --- a/src/views/UptimeMyChainBlocks.vue +++ b/src/views/UptimeMyChainBlocks.vue @@ -209,7 +209,7 @@ export default { if (x.validator_address) sigs[x.validator_address] = 'bg-success' }) 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 // this.$set(block, 0, typeof sigs !== 'undefined') if (this.blocks.length >= 50) this.blocks.shift()