Skip to content

Commit

Permalink
fix bug where channel is off by 1 (#85)
Browse files Browse the repository at this point in the history
* ch settings is 1 indexed ;-;

* fix
  • Loading branch information
dtinth committed Aug 20, 2023
1 parent c333901 commit 662fdd7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/core/MainView.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ export class MainView extends React.Component {
}
if (e.ctrlKey) {
if (e.keyCode >= 0x30 && e.keyCode <= 0x39) {
switchOutputChannel(e.keyCode === 0x30 ? 9 : e.keyCode - 0x31)
switchOutputChannel(e.keyCode === 0x30 ? 10 : e.keyCode - 0x30)
e.preventDefault()
return
}
Expand Down
4 changes: 2 additions & 2 deletions src/core/switchOutputChannel.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ export function OutputChannelSwitcher() {
useEffect(() => {
switchOutputChannel = (channel) => {
mainChannel.setValue(String(channel));
showInformationMessage('Switched output channel to ch.' + (channel + 1));
showInformationMessage('Switched output channel to ch.' + channel);
};
}, [mainChannel.setValue]);
return <StatusBarItem>ch.{+mainChannel.value + 1}</StatusBarItem>;
return <StatusBarItem>ch.{mainChannel.value}</StatusBarItem>;
}

0 comments on commit 662fdd7

Please sign in to comment.