From 272956025cb6b323c1d214bac85c7f2b5a0ede09 Mon Sep 17 00:00:00 2001 From: Nelson Chan Date: Sun, 1 May 2022 05:18:08 +0800 Subject: [PATCH] Fix: Fix chart error on switch back to recent --- src/components/PingChart.vue | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/components/PingChart.vue b/src/components/PingChart.vue index d4f94a191..eb907e2de 100644 --- a/src/components/PingChart.vue +++ b/src/components/PingChart.vue @@ -218,7 +218,6 @@ export default { // Update chart data when the selected chart period changes chartPeriodHrs: function (newPeriod) { if (newPeriod === "0") { - newPeriod = null; this.heartbeatList = null; this.$root.storage().removeItem(`chart-period-${this.monitorId}`); } else { @@ -241,7 +240,7 @@ export default { // And mirror latest change to this.heartbeatList this.$watch(() => this.$root.heartbeatList[this.monitorId], (heartbeatList) => { - if (this.chartPeriodHrs !== 0) { + if (this.chartPeriodHrs !== "0") { const newBeat = heartbeatList.at(-1); if (newBeat && dayjs.utc(newBeat.time) > dayjs.utc(this.heartbeatList.at(-1)?.time)) { this.heartbeatList.push(heartbeatList.at(-1));