|
@ -12,8 +12,19 @@ export function pushToClickLog(logElement) { |
|
|
return; |
|
|
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; |
|
|
const sensorLog = getState().sensorLog; |
|
|
sensorLog.clickedElements.push(logElement); |
|
|
|
|
|
|
|
|
sensorLog.clickedElements.push(generateLogElement(logElement)); |
|
|
setState({ sensorLog: sensorLog }); |
|
|
setState({ sensorLog: sensorLog }); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|