aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStanley Yip <stanley_yip@brown.edu>2020-04-05 13:25:25 -0700
committerStanley Yip <stanley_yip@brown.edu>2020-04-05 13:25:25 -0700
commitd352658347f82d95653bb31b3c9f45d95d64ca41 (patch)
tree235db444202390cca77fb958636ecda788318e02
parent807743bdd351b639e3328fa1ed6f128738f95b9f (diff)
some other changes
-rw-r--r--src/client/views/GestureOverlay.tsx8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/client/views/GestureOverlay.tsx b/src/client/views/GestureOverlay.tsx
index 68f1d13fb..9075f8bfa 100644
--- a/src/client/views/GestureOverlay.tsx
+++ b/src/client/views/GestureOverlay.tsx
@@ -193,7 +193,7 @@ export default class GestureOverlay extends Touchable {
}, (500));
}
else {
- clearTimeout(this._holdTimer);
+ this._holdTimer && clearTimeout(this._holdTimer);
}
document.removeEventListener("touchmove", this.onReactTouchMove);
document.removeEventListener("touchend", this.onReactTouchEnd);
@@ -270,7 +270,7 @@ export default class GestureOverlay extends Touchable {
onReactTouchMove = (e: TouchEvent) => {
const nts: any = this.getNewTouches(e);
- clearTimeout(this._holdTimer);
+ this._holdTimer && clearTimeout(this._holdTimer);
this._holdTimer = undefined;
document.dispatchEvent(
@@ -290,7 +290,7 @@ export default class GestureOverlay extends Touchable {
onReactTouchEnd = (e: TouchEvent) => {
const nts: any = this.getNewTouches(e);
- clearTimeout(this._holdTimer);
+ this._holdTimer && clearTimeout(this._holdTimer);
this._holdTimer = undefined;
document.dispatchEvent(
@@ -323,7 +323,7 @@ export default class GestureOverlay extends Touchable {
}
handleHandDown = async (e: React.TouchEvent) => {
- clearTimeout(this._holdTimer!);
+ this._holdTimer && clearTimeout(this._holdTimer);
const fingers = new Array<React.Touch>();
for (let i = 0; i < e.touches.length; i++) {
const pt: any = e.touches.item(i);