From f113b0485f6de36fccab428f1d2168040ab215b2 Mon Sep 17 00:00:00 2001 From: hippoz Date: Mon, 8 Nov 2021 17:02:05 +0200 Subject: [PATCH] remove unneeded calls --- frontend/src/Connection.js | 6 +++--- frontend/src/Touchpad.js | 5 ----- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/frontend/src/Connection.js b/frontend/src/Connection.js index ab74b0c..75e4113 100644 --- a/frontend/src/Connection.js +++ b/frontend/src/Connection.js @@ -43,15 +43,15 @@ class Connection { sendMessage(code, params=[]) { let message = code; - params.forEach((param, i) => { + for (let i = 0; i < params.length; i++) { + const param = params[i]; if (i == params.length - 1) message += param; else message += param + ";"; - }); + } this.ws.send(message); - return message; } disconnect() { diff --git a/frontend/src/Touchpad.js b/frontend/src/Touchpad.js index c7229b3..3c8d2cb 100644 --- a/frontend/src/Touchpad.js +++ b/frontend/src/Touchpad.js @@ -84,7 +84,6 @@ class TouchpadController { onTouchMove(event) { const touches = event.changedTouches; event.preventDefault(); - event.stopPropagation(); const targetTouch = touches[0]; @@ -133,8 +132,6 @@ class TouchpadController { onTouchEnd(event) { const changedTouches = event.changedTouches; - event.preventDefault(); - event.stopPropagation(); this.shouldResetLastMove = true; if (changedTouches.length === 1) { @@ -160,8 +157,6 @@ class TouchpadController { onTouchStart(event) { const changedTouches = event.changedTouches; - event.preventDefault(); - event.stopPropagation(); // Clear the hold mode time out if another touch begins if (this.holdModeTimeout)