From ad021f7714c3ba1a3fbeade61f5e8b970aea383c Mon Sep 17 00:00:00 2001 From: Joe Pavitt Date: Fri, 19 Jan 2024 11:29:50 +0000 Subject: [PATCH] UI Chart - Ensure server-side store also replaces if "replace" action is chosen --- nodes/widgets/ui_chart.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/nodes/widgets/ui_chart.js b/nodes/widgets/ui_chart.js index 895a113b3..668083e77 100644 --- a/nodes/widgets/ui_chart.js +++ b/nodes/widgets/ui_chart.js @@ -142,6 +142,10 @@ module.exports = function (RED) { // clear history datastore.save(base, node, []) } else { + if (config.action === 'replace') { + // clear our data store as we are replacing data + datastore.save(base, node, []) + } if (!Array.isArray(msg.payload)) { // quick clone of msg, and store in history datastore.append(base, node, {