refactor: setup global timer state (#629)

* refactor: setup global timer state

---------

Co-authored-by: Carlos Valente <34649812+cpvalente@users.noreply.github.com>
Co-authored-by: Carlos Valente <carlosvalente@pm.me>
This commit is contained in:
Alex Rohleder
2024-01-12 13:03:58 +01:00
committed by GitHub
parent e6bb52ad9c
commit f965db148c
12 changed files with 666 additions and 453 deletions
@@ -28,6 +28,7 @@ import {
import { logger } from '../../classes/Logger.js';
import { validateEvent } from '../../utils/parser.js';
import { clock } from '../Clock.js';
import { state } from '../../state.js';
/**
* Forces rundown to be recalculated
@@ -123,7 +124,7 @@ export function updateTimer(affectedIds?: string[]) {
if (eventInMemory) {
eventLoader.reset();
if (eventTimer.playback === Playback.Roll) {
if (state.playback === Playback.Roll) {
const rollTimers = eventLoader.findRoll(clock.timeNow());
if (rollTimers === null) {
eventTimer.stop();