If you happen to call stopWatch on the onShake event, the
previousAcceleration was not erased, and when startWatch was called
again, the onShake was invoked because the difference between
acceleration and previousAcceleration was still present.
So, this commit ensure that previous state is nullify on stopWatch.
If you happen to call
stopWatch
on theonShake
event, thepreviousAcceleration
was not erased, and whenstartWatch
was called again, theonShake
was invoked because the difference betweenacceleration
andpreviousAcceleration
was still present.So, this commit ensure that previous state is nullify on
stopWatch
.