Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix that addAction wouldn't have any effect without a stop and start #1001

Merged
merged 3 commits into from
Sep 22, 2022

Conversation

eoghanmurray
Copy link
Contributor

@eoghanmurray eoghanmurray commented Sep 15, 2022

addActions (not addAction) had a bug where it would replace this.actions rather than mutating it, causing the actions array in the raf loop to fail to get new actions (because it still referred to the previous incarnation of this.actions)

Noticed during live mode where I don't think addActions is actually used, so there may be another bug lurking here.

@@ -202,7 +201,7 @@ export function createPlayerService(
syncEvents.push(event);
} else {
const castFn = getCastFn(event, false);
actions.push({
timer.addAction({
doAction: () => {
castFn();
},
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

addAction directly here should be fine (before we apply syncEvents) because the timer hasn't started yet

…ons` - refactor to reuse `addAction` and add a `push` fast-track to this function for the common case of adding actions in the correct order
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants