diff --git a/frontend/static/js/api/game/Game.js b/frontend/static/js/api/game/Game.js index e8a3e5f..f5e708d 100644 --- a/frontend/static/js/api/game/Game.js +++ b/frontend/static/js/api/game/Game.js @@ -73,13 +73,10 @@ class Game if (this._socket === undefined) return; - const loop_id = setInterval(() => { - if (this._socket.readyState === WebSocket.OPEN) - { - this._socket.send(JSON.stringify(data)); - clearInterval(loop_id); - } - }, 500); + if (this._socket.readyState === WebSocket.OPEN) + { + this._socket.send(JSON.stringify(data)); + } } _send_paddle_position(position, time) @@ -208,4 +205,4 @@ class Game } } -export { Game } \ No newline at end of file +export { Game }