From baa81126c485434211cb6d58292f77de00dc2432 Mon Sep 17 00:00:00 2001 From: missionfloyd Date: Mon, 29 May 2023 23:52:19 -0600 Subject: [PATCH] Move gamepaddisconnected listener --- javascript/imageviewerGamepad.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/javascript/imageviewerGamepad.js b/javascript/imageviewerGamepad.js index 45cc4cbf9..a22c7e6e6 100644 --- a/javascript/imageviewerGamepad.js +++ b/javascript/imageviewerGamepad.js @@ -24,7 +24,10 @@ window.addEventListener('gamepadconnected', (e) => { isWaiting = false; } }, 10); - window.addEventListener('gamepaddisconnected', (e) => clearInterval(gamepads[e.gamepad.index])); +}); + +window.addEventListener('gamepaddisconnected', (e) => { + clearInterval(gamepads[e.gamepad.index]); }); /*