Skip to content

Commit

Permalink
Merge pull request tv2#223 from nrkno/fix/default-label-fallback
Browse files Browse the repository at this point in the history
Fix/default label fallback
  • Loading branch information
olzzon authored Feb 14, 2022
2 parents 21e7e24 + f854be0 commit c3b9761
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 12 deletions.
13 changes: 7 additions & 6 deletions client/utils/labels.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,18 +30,19 @@ export function getFaderLabel(faderIndex: number, defaultName = 'CH'): string {
const channelLabel = getChannelLabel(state, faderIndex)

switch (state.settings[0].labelType) {
case 'automation':
return automationLabel || defaultName + ' ' + (faderIndex + 1)
case 'user':
return userLabel || defaultName + ' ' + (faderIndex + 1)
case 'channel':
return channelLabel || defaultName + ' ' + (faderIndex + 1)
case 'automatic':
default:
return (
userLabel ||
automationLabel ||
channelLabel ||
defaultName + ' ' + (faderIndex + 1)
)
case 'automation':
return automationLabel || defaultName + ' ' + (faderIndex + 1)
case 'user':
return userLabel || defaultName + ' ' + (faderIndex + 1)
case 'channel':
return channelLabel || defaultName + ' ' + (faderIndex + 1)
}
}
13 changes: 7 additions & 6 deletions server/utils/labels.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,18 +31,19 @@ export function getFaderLabel(faderIndex: number, defaultName = 'CH'): string {
const channelLabel = getChannelLabel(state, faderIndex)

switch (state.settings[0].labelType) {
case 'automation':
return automationLabel || defaultName + ' ' + (faderIndex + 1)
case 'user':
return userLabel || defaultName + ' ' + (faderIndex + 1)
case 'channel':
return channelLabel || defaultName + ' ' + (faderIndex + 1)
case 'automatic':
default:
return (
userLabel ||
automationLabel ||
channelLabel ||
defaultName + ' ' + (faderIndex + 1)
)
case 'automation':
return automationLabel || defaultName + ' ' + (faderIndex + 1)
case 'user':
return userLabel || defaultName + ' ' + (faderIndex + 1)
case 'channel':
return channelLabel || defaultName + ' ' + (faderIndex + 1)
}
}

0 comments on commit c3b9761

Please sign in to comment.