From 0170909afd2a847f01c4930c86f201bb1c66a5e1 Mon Sep 17 00:00:00 2001 From: e7d Date: Sun, 14 May 2017 11:40:43 +0200 Subject: [PATCH] fixed gamepad refresh to be done only if there is an active gamepad --- js/gamepad.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/js/gamepad.js b/js/gamepad.js index c0054ee..1b395fd 100644 --- a/js/gamepad.js +++ b/js/gamepad.js @@ -215,13 +215,13 @@ class Gamepad { } updateVisualStatus() { - this.refreshGamepads(); - // ensure that a gamepad is currently active if (!this.activeGamepad) { return; } + this.refreshGamepads(); + requestAnimationFrame(this.updateVisualStatus.bind(this)); let button;