From e4be28a9e748086d12b50799f151b35a7e09e091 Mon Sep 17 00:00:00 2001 From: Nelson Chan Date: Fri, 22 Oct 2021 19:07:11 +0800 Subject: [PATCH] Fix: Validate beat time before appending --- src/components/PingChart.vue | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/components/PingChart.vue b/src/components/PingChart.vue index cd5e239c..adbca1b6 100644 --- a/src/components/PingChart.vue +++ b/src/components/PingChart.vue @@ -230,7 +230,10 @@ export default { this.$watch(() => this.$root.heartbeatList[this.monitorId], (heartbeatList) => { if (this.chartPeriodHrs != 0) { - this.heartbeatList.push(heartbeatList.at(-1)); + const newBeat = heartbeatList.at(-1); + if (newBeat && dayjs.utc(newBeat.time) > dayjs.utc(this.heartbeatList.at(-1)?.time)) { + this.heartbeatList.push(heartbeatList.at(-1)); + } } }, { deep: true }