From 0dfb06d65642e76eaaece8b30cd4343289bb26b9 Mon Sep 17 00:00:00 2001 From: Stefan Dej Date: Sun, 21 Mar 2021 02:05:31 +0100 Subject: [PATCH] bugfix: only accept data later than the last entry of the dataset (tempchart) Signed-off-by: Stefan Dej --- src/store/printer/tempHistory/mutations.js | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/store/printer/tempHistory/mutations.js b/src/store/printer/tempHistory/mutations.js index 0f784bab..b2f3a613 100644 --- a/src/store/printer/tempHistory/mutations.js +++ b/src/store/printer/tempHistory/mutations.js @@ -27,10 +27,15 @@ export default { ]) } } else { - dataset.data.push([ - payload.time, - Math.round(payload.value * multi * 100)/100 - ]) + if ( + dataset.data.length && + dataset.data[dataset.data.length-1][0] < payload.time + ) { + dataset.data.push([ + payload.time, + Math.round(payload.value * multi * 100)/100 + ]) + } let i const timeOld = new Date().getTime() - (1000 * payload.maxHistory)