message: Resize based on length instead
diff: @@ -41,8 +41,11 @@ export class HotkeyButton extends React.Component<Props, State> {
  let gamepadIdx = 0;
  for (const gamepad of gamepads) {
  - if (gamepad === null) { continue; }
  + if (gamepadIdx >= oldButtonState.length) {
  + oldButtonState[gamepadIdx] = [];
  + }
  + if (gamepad !== null) {
  let buttonIdx = 0;
  for (const button of gamepad.buttons) {
  const oldState = oldButtonState[gamepadIdx]?.[buttonIdx] ?? false;
  @@ -50,13 +53,11 @@ export class HotkeyButton extends React.Component<Props, State> {
  this.props.setValue(`Gamepad${buttonIdx}`);
  }
  - if (oldButtonState[gamepadIdx] === undefined) {
  - oldButtonState[gamepadIdx] = [];
  - }
  oldButtonState[gamepadIdx][buttonIdx] = button.pressed;
  buttonIdx++;
  }
  + }
  gamepadIdx++;
  }
  