leecrossley / cordova-plugin-shake

Cordova / PhoneGap Plugin to detect when a physical device performs a shake gesture
http://ilee.co.uk
92 stars 33 forks source link

Nullify previousAcceleration on stopWatch #13

Closed chatgris closed 9 years ago

chatgris commented 9 years ago

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.

leecrossley commented 9 years ago

Thanks for spotting this, I'll bump the version and publish

chatgris commented 9 years ago

Thanks for being so reactive to merge and publish. :kissing_smiling_eyes: