Skip to content

Commit

Permalink
Don't run this listener function if not connected to a machine
Browse files Browse the repository at this point in the history
  • Loading branch information
walidkayhan committed Jan 22, 2024
1 parent 7bd648f commit 0a2e7c0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/app/widgets/JogControl/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -1048,7 +1048,7 @@ class AxesWidget extends PureComponent {
gamepad.on('gamepad:button', throttle((event) => runAction({ event, shuttleControlEvents: this.shuttleControlEvents })), 50, { leading: false, trailing: true });

gamepad.on('gamepad:axis', ({ detail }) => {
if (gamepad.shouldHold) {
if (gamepad.shouldHold || !this.props.isConnected) {
return;
}

Expand Down Expand Up @@ -1112,7 +1112,7 @@ class AxesWidget extends PureComponent {
});

gamepad.on('gamepad:axis', throttle(({ detail }) => {
if (gamepad.shouldHold) {
if (gamepad.shouldHold || !this.props.isConnected) {
return;
}

Expand Down

0 comments on commit 0a2e7c0

Please sign in to comment.