Skip to content

Commit

Permalink
fix: update action-recorder to new delay/wait flow #3189
Browse files Browse the repository at this point in the history
  • Loading branch information
Julusian committed Jan 19, 2025
1 parent c986a98 commit 145fe9e
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions companion/lib/Controls/ActionRecorder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -364,13 +364,18 @@ export class ActionRecorder extends EventEmitter<ActionRecorderEvents> {

// Update or push the delay before the current one
const oldPrevAction = session.actions[uniquenessIdIndex - 1]
if (oldPrevAction.instance === delayAction.instance && oldPrevAction.action === delayAction.action) {
if (
oldPrevAction &&
oldPrevAction.instance === delayAction.instance &&
oldPrevAction.action === delayAction.action
) {
session.actions[uniquenessIdIndex - 1] = delayAction
} else {
session.actions.splice(uniquenessIdIndex - 1, 0, delayAction)
} else if (delay > 0) {
session.actions.splice(uniquenessIdIndex, 0, delayAction)
}
} else {
session.actions.push(delayAction, newAction)
if (delay > 0) session.actions.push(delayAction)
session.actions.push(newAction)
}

changedSessionIds.push(session.id)
Expand Down

0 comments on commit 145fe9e

Please sign in to comment.