Skip to content

Commit

Permalink
fix: if size of mixer changed, SET_ASSIGNED_FADER gave an error
Browse files Browse the repository at this point in the history
  • Loading branch information
olzzon committed Jul 26, 2023
1 parent 487d15c commit 9371ae1
Showing 1 changed file with 15 additions and 13 deletions.
28 changes: 15 additions & 13 deletions shared/src/reducers/channelsReducer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ import {

export interface IChannels {
chMixerConnection: IchMixerConnection[]
}
export interface IchMixerConnection {
}

export interface IchMixerConnection {
channel: Array<IChannel>
}
export interface IChannel {
}

export interface IChannel {
channelType: number
channelTypeIndex: number
assignedFader: number
Expand All @@ -29,11 +29,11 @@ export interface IChannels {
private?: {
[key: string]: string
}
}
export interface InumberOfChannels {
}

export interface InumberOfChannels {
numberOfTypeInCh: number[]
}
}

const defaultChannelsReducerState = (
numberOfChannels: InumberOfChannels[]
Expand Down Expand Up @@ -124,9 +124,11 @@ export const channels = (
].fadeActive = !!action.active
return nextState
case SET_ASSIGNED_FADER:
nextState[0].chMixerConnection[action.mixerIndex].channel[
action.channel
].assignedFader = action.faderNumber
if (nextState[0].chMixerConnection[action.mixerIndex].channel.length > action.channel) {
nextState[0].chMixerConnection[action.mixerIndex].channel[
action.channel
].assignedFader = action.faderNumber
}
return nextState
case SET_AUX_LEVEL:
let auxLevels =
Expand Down

0 comments on commit 9371ae1

Please sign in to comment.