Skip to content

Commit

Permalink
fix: toggleShowChannelStrip toggle between channels
Browse files Browse the repository at this point in the history
  • Loading branch information
olzzon committed Nov 22, 2019
1 parent 172a7f3 commit 22abc5f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
7 changes: 3 additions & 4 deletions src/components/ChanStrip.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,13 @@ class ChanStrip extends React.PureComponent<IChanStripProps & IChanStripInjectPr

constructor(props: any) {
super(props);
this.faderIndex = this.props.faderIndex;
this.mixerProtocol = MixerProtocolPresets[this.props.selectedProtocol];
}

handleShowRoutingOptions() {
this.props.dispatch({
type: TOGGLE_SHOW_OPTION,
channel: this.faderIndex
channel: this.props.faderIndex
});
this.props.dispatch({
type: TOGGLE_SHOW_CHAN_STRIP,
Expand Down Expand Up @@ -64,7 +63,7 @@ class ChanStrip extends React.PureComponent<IChanStripProps & IChanStripInjectPr
min={0}
max={1}
step={0.01}
value= {this.props.fader[this.faderIndex].faderLevel}
value= {this.props.fader[this.props.faderIndex].faderLevel}
onChange={(event: any) => {
}}
/>
Expand All @@ -77,7 +76,7 @@ class ChanStrip extends React.PureComponent<IChanStripProps & IChanStripInjectPr
<div className="chan-strip-body">
<h2>
CHANNEL STRIP:
{this.props.label || ("FADER " + (this.faderIndex + 1))}</h2>
{this.props.label || ("FADER " + (this.props.faderIndex + 1))}</h2>
<button
className="close"
onClick={() => this.handleClose()}
Expand Down
7 changes: 6 additions & 1 deletion src/reducers/settingsReducer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,12 @@ export const settings = (state = defaultSettingsReducerState, action: any): Arra
nextState[0].showSettings = !nextState[0].showSettings;
return nextState;
case TOGGLE_SHOW_CHAN_STRIP:
nextState[0].showChanStrip = action.channel;
if (nextState[0].showChanStrip !== action.channel) {
nextState[0].showChanStrip = action.channel;
}
else {
nextState[0].showChanStrip = -1;
}
return nextState;
case TOGGLE_SHOW_OPTION:
nextState[0].showOptions = typeof nextState[0].showOptions === 'number' ? false : action.channel;
Expand Down

0 comments on commit 22abc5f

Please sign in to comment.