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(ticker): Fix wrong sound playing on auto-advance #365

Merged
merged 1 commit into from
Mar 11, 2024

Conversation

Hanziness
Copy link
Owner

When auto-advancing was re-implemented in #361, the app started playing the wrong sound when the section automatically advanced. This was caused by Vue handling the section advance the following way:

  1. The events store receives the TIMER_FINISH event (-> there is a watcher in the web component that plays the next section's sound based on this event)
  2. The schedule store gets the call to advance the current section
  3. The watcher plays the sound of the next section (but by this time, the schedule has already advanced, so it will play the second next section's sound)

This is fixed by wrapping the advance() call in a nextTick, so the correct sound will start playing in the current tick, and only then will the schedule advance.

@Hanziness Hanziness added the bug 🐛 Something isn't working label Mar 11, 2024
@Hanziness Hanziness linked an issue Mar 11, 2024 that may be closed by this pull request
@Hanziness Hanziness merged commit f62ef40 into develop Mar 11, 2024
1 check passed
@Hanziness Hanziness deleted the 364-wrong-sound-plays-on-auto-advance branch March 11, 2024 17:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Wrong sound plays on auto-advance
1 participant