fix v2 roll timer (#363)

* fix: roll update skips elapsed time

* refactor: remove unused data

* style: fix style in roll state
This commit is contained in:
Carlos Valente
2023-04-26 22:02:04 +02:00
committed by GitHub
parent 40d389acc9
commit 4bceae65ab
7 changed files with 24 additions and 106 deletions
@@ -1,10 +1,11 @@
import { ReactNode, useMemo } from 'react';
import { Playback, TitleBlock } from 'ontime-types';
import { useStore } from 'zustand';
import useEventData from '../../common/hooks-query/useEventData';
import useRundown from '../../common/hooks-query/useRundown';
import useViewSettings from '../../common/hooks-query/useViewSettings';
import { useRuntimeStore } from '../../common/stores/runtime';
import { runtime } from '../../common/stores/runtime';
import { useViewOptionsStore } from '../../common/stores/viewOptions';
export type TitleManager = TitleBlock & { showNow: boolean; showNext: boolean };
@@ -27,7 +28,7 @@ const withData = (Component: ReactNode) => {
}, [eventsData]);
// websocket data
const data = useRuntimeStore();
const data = useStore(runtime);
const { timer, titles, titlesPublic, publicMessage, timerMessage, lowerMessage, playback, onAir } = data;
const publicSelectedId = data.loaded.selectedPublicEventId;
const selectedId = data.loaded.selectedEventId;
@@ -90,7 +90,7 @@ export default function Countdown(props: CountdownProps) {
return null;
}
const standby = time.playback !== Playback.Play && selectedId === follow?.id;
const standby = time.playback !== Playback.Play && time.playback !== Playback.Roll && selectedId === follow?.id;
const isRunningFinished = time.finished && runningMessage === TimerMessage.running;
const isSelected = runningMessage === TimerMessage.running;
const delayedTimerStyles = delay > 0 ? 'aux-timers__value--delayed' : '';