Browse Source

fix: Fixed non-logging of visit log.

master
Denis Thiessen 5 months ago
parent
commit
b7e186a3db
  1. 22
      src/core/log/SensorLogger.jsx

22
src/core/log/SensorLogger.jsx

@ -33,6 +33,17 @@ export function pushToClickLog(logElement) {
setState({ sensorLog: sensorLog });
}
const addLogElement = function (logElement) {
const sensorLog = getState().sensorLog;
const currentTime = new Date();
const visitLogElement = {
visitLog: logElement,
timestamp: currentTime,
};
sensorLog.visitedSites.push(visitLogElement);
setState({ sensorLog: sensorLog });
};
export function pushToVisitLog(logElement) {
const sensorLog = getState().sensorLog;
@ -46,14 +57,9 @@ export function pushToVisitLog(logElement) {
) {
return;
}
const currentTime = new Date();
const visitLogElement = {
visitLog: logElement,
timestamp: currentTime,
};
sensorLog.visitedSites.push(visitLogElement);
setState({ sensorLog: sensorLog });
addLogElement(logElement);
} else if (visitedSitesAmount === 0) {
addLogElement(logElement);
}
}

Loading…
Cancel
Save