Skip to content

Commit

Permalink
fix(ticker): Delegate schedule advance to the next tick to fix the wr…
Browse files Browse the repository at this point in the history
…ong sound playing (#365)
  • Loading branch information
Hanziness committed Mar 11, 2024
1 parent 3ea1bf8 commit f62ef40
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion components/ticker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -153,10 +153,13 @@ export function useTicker () {
if (nextState === TimerState.RUNNING && isTimerJustFinished) {
// timer completed, notify participants
eventsStore.recordEvent(EventType.TIMER_FINISH)

if (settingsStore.sectionEndAction === SectionEndAction.Stop) {
scheduleStore.timerState = TimerState.COMPLETED
} else if (settingsStore.sectionEndAction === SectionEndAction.Skip) {
scheduleStore.advance()
nextTick(() => {
scheduleStore.advance()
})
}
}
}
Expand Down

0 comments on commit f62ef40

Please sign in to comment.