Merge branch 'louislam:master' into bulgarian

This commit is contained in:
MrEddX 2022-04-15 13:03:34 +03:00 committed by GitHub
commit 9ec652639b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 0 deletions

View File

@ -220,6 +220,7 @@ export default {
if (newPeriod == "0") {
newPeriod = null;
this.heartbeatList = null;
this.$root.storage().removeItem(`chart-period-${this.monitorId}`);
} else {
this.loading = true;
@ -228,6 +229,7 @@ export default {
toast.error(res.msg);
} else {
this.heartbeatList = res.data;
this.$root.storage()[`chart-period-${this.monitorId}`] = newPeriod;
}
this.loading = false;
});
@ -248,6 +250,12 @@ export default {
},
{ deep: true }
);
// Load chart period from storage if saved
let period = this.$root.storage()[`chart-period-${this.monitorId}`];
if (period != null) {
this.chartPeriodHrs = Math.min(period, 6);
}
}
};
</script>