From 486cd86f97dcf914e9d9f9aac3afa857f3c2bec0 Mon Sep 17 00:00:00 2001 From: Denis Thiessen Date: Sun, 2 Jun 2024 13:39:03 +0200 Subject: [PATCH] fix: Fixed click logging. --- src/core/log/SensorLogger.jsx | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/core/log/SensorLogger.jsx b/src/core/log/SensorLogger.jsx index f481235..0388052 100644 --- a/src/core/log/SensorLogger.jsx +++ b/src/core/log/SensorLogger.jsx @@ -12,8 +12,19 @@ export function pushToClickLog(logElement) { return; } + const generateLogElement = (el) => { + const currentTime = new Date(); + return { + target: el.target.outerHTML, + type: el.type, + x: el.x, + y: el.y, + timestamp: currentTime, + }; + }; + const sensorLog = getState().sensorLog; - sensorLog.clickedElements.push(logElement); + sensorLog.clickedElements.push(generateLogElement(logElement)); setState({ sensorLog: sensorLog }); }