mirror of
https://github.com/louislam/uptime-kuma.git
synced 2024-11-23 23:04:04 +00:00
Fix: Fix chart error on switch back to recent
This commit is contained in:
parent
db50ba91cc
commit
272956025c
1 changed files with 1 additions and 2 deletions
|
@ -218,7 +218,6 @@ export default {
|
||||||
// Update chart data when the selected chart period changes
|
// Update chart data when the selected chart period changes
|
||||||
chartPeriodHrs: function (newPeriod) {
|
chartPeriodHrs: function (newPeriod) {
|
||||||
if (newPeriod === "0") {
|
if (newPeriod === "0") {
|
||||||
newPeriod = null;
|
|
||||||
this.heartbeatList = null;
|
this.heartbeatList = null;
|
||||||
this.$root.storage().removeItem(`chart-period-${this.monitorId}`);
|
this.$root.storage().removeItem(`chart-period-${this.monitorId}`);
|
||||||
} else {
|
} else {
|
||||||
|
@ -241,7 +240,7 @@ export default {
|
||||||
// And mirror latest change to this.heartbeatList
|
// And mirror latest change to this.heartbeatList
|
||||||
this.$watch(() => this.$root.heartbeatList[this.monitorId],
|
this.$watch(() => this.$root.heartbeatList[this.monitorId],
|
||||||
(heartbeatList) => {
|
(heartbeatList) => {
|
||||||
if (this.chartPeriodHrs !== 0) {
|
if (this.chartPeriodHrs !== "0") {
|
||||||
const newBeat = heartbeatList.at(-1);
|
const newBeat = heartbeatList.at(-1);
|
||||||
if (newBeat && dayjs.utc(newBeat.time) > dayjs.utc(this.heartbeatList.at(-1)?.time)) {
|
if (newBeat && dayjs.utc(newBeat.time) > dayjs.utc(this.heartbeatList.at(-1)?.time)) {
|
||||||
this.heartbeatList.push(heartbeatList.at(-1));
|
this.heartbeatList.push(heartbeatList.at(-1));
|
||||||
|
|
Loading…
Reference in a new issue