Skip to content

Commit 78ef630

Browse files
author
Balte de Wit
committed
fix: prevent falsy checks for input = 0
1 parent 3fb3936 commit 78ef630

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/resolvers/mixEffect.ts

+6-2
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,13 @@ export function resolveMixEffectsState (oldState: StateObject, newState: StateOb
2020
}
2121
const oldMixEffect = oldState.video.ME[mixEffectId]
2222
const newMixEffect = newState.video.ME[mixEffectId]
23+
2324
if (!oldMixEffect || !newMixEffect) continue
25+
26+
let oldMEInput = oldMixEffect.input
27+
if (typeof oldMEInput === 'undefined') oldMEInput = oldMixEffect.programInput
28+
2429
if (typeof newMixEffect.input !== 'undefined' && typeof newMixEffect.transition !== 'undefined') {
25-
const oldMEInput = oldMixEffect.input || oldMixEffect.programInput
2630
if (newMixEffect.input !== oldMEInput || newMixEffect.transition === Enums.TransitionStyle.DUMMY) {
2731
const command = new AtemCommands.PreviewInputCommand()
2832
command.mixEffect = Number(mixEffectId)
@@ -58,7 +62,7 @@ export function resolveMixEffectsState (oldState: StateObject, newState: StateOb
5862
command.updateProps({ source: newMixEffect.previewInput })
5963
commands.push(command)
6064
}
61-
if ((oldMixEffect.input || oldMixEffect.programInput) !== newMixEffect.programInput) {
65+
if (oldMEInput !== newMixEffect.programInput) {
6266
// @todo: check if we need to use the cut command?
6367
// use cut command if:
6468
// DSK is tied

0 commit comments

Comments
 (0)