Dealt with an edge case
Dealt with an edge case where there are no strokes detected, but a number of impulses is recorded (Typically during first calibration).
This commit is contained in:
parent
65b273bbea
commit
97c1da96d6
|
|
@ -311,8 +311,12 @@ function createWorkoutRecorder () {
|
||||||
function minimumRecordingTimeHasPassed () {
|
function minimumRecordingTimeHasPassed () {
|
||||||
const minimumRecordingTimeInSeconds = 10
|
const minimumRecordingTimeInSeconds = 10
|
||||||
const rotationImpulseTimeTotal = rotationImpulses.reduce((acc, impulse) => acc + impulse, 0)
|
const rotationImpulseTimeTotal = rotationImpulses.reduce((acc, impulse) => acc + impulse, 0)
|
||||||
const strokeTimeTotal = strokes[strokes.length - 1].totalMovingTime
|
if (strokes.length > 0) {
|
||||||
return (Math.max(rotationImpulseTimeTotal, strokeTimeTotal) > minimumRecordingTimeInSeconds)
|
const strokeTimeTotal = strokes[strokes.length - 1].totalMovingTime
|
||||||
|
return (Math.max(rotationImpulseTimeTotal, strokeTimeTotal) > minimumRecordingTimeInSeconds)
|
||||||
|
} else {
|
||||||
|
return (rotationImpulseTimeTotal > minimumRecordingTimeInSeconds)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue