Skip to content

Commit

Permalink
Move gamepaddisconnected listener
Browse files Browse the repository at this point in the history
  • Loading branch information
missionfloyd committed May 30, 2023
1 parent 679e873 commit baa8112
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion javascript/imageviewerGamepad.js
Original file line number Diff line number Diff line change
Expand Up @@ -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]);
});

/*
Expand Down

0 comments on commit baa8112

Please sign in to comment.