diff --git a/apps/client/src/common/hooks/useSocket.ts b/apps/client/src/common/hooks/useSocket.ts index 3bfbb92c5..449148944 100644 --- a/apps/client/src/common/hooks/useSocket.ts +++ b/apps/client/src/common/hooks/useSocket.ts @@ -164,11 +164,6 @@ export const useProgressData = createSelector((state: RuntimeStore) => ({ timeDanger: state.eventNow?.timeDanger ?? null, })); -export const useTimelineStatus = createSelector((state: RuntimeStore) => ({ - clock: state.clock, - offset: state.offset.absolute, -})); - export const useExpectedStartData = createSelector((state: RuntimeStore) => ({ offset: state.offset.mode === OffsetMode.Absolute ? state.offset.absolute : state.offset.relative, mode: state.offset.mode, @@ -178,14 +173,6 @@ export const useExpectedStartData = createSelector((state: RuntimeStore) => ({ clock: state.clock, })); -export const useCurrentDay = createSelector((state: RuntimeStore) => ({ - currentDay: state.eventNow?.dayOffset ?? 0, -})); - -export const useRuntimeOffset = createSelector((state: RuntimeStore) => ({ - offset: state.offset.absolute, -})); - export const usePing = createSelector((state: RuntimeStore) => ({ ping: state.ping, })); @@ -211,7 +198,7 @@ export const usePlayback = () => { /* ======================= Overview data subscriptions ======================= */ -export const useRundownOverview = createSelector((state: RuntimeStore) => ({ +export const useStartTimesOverview = createSelector((state: RuntimeStore) => ({ plannedStart: state.rundown.plannedStart, actualStart: state.rundown.actualStart, plannedEnd: state.rundown.plannedEnd, @@ -289,11 +276,7 @@ export const useStudioTimersSocket = createSelector((state: RuntimeStore) => ({ eventNow: state.eventNow, message: state.message, time: state.timer, - offset: state.offset, + offset: state.offset.mode === OffsetMode.Absolute ? state.offset.absolute : state.offset.relative, rundown: state.rundown, -})); - -export const useTimelineSocket = createSelector((state: RuntimeStore) => ({ - clock: state.clock, - offset: state.offset.absolute, + expectedRundownEnd: state.offset.expectedRundownEnd, })); diff --git a/apps/client/src/features/overview/composite/TimeElements.tsx b/apps/client/src/features/overview/composite/TimeElements.tsx index 17ee75868..df018e237 100644 --- a/apps/client/src/features/overview/composite/TimeElements.tsx +++ b/apps/client/src/features/overview/composite/TimeElements.tsx @@ -20,7 +20,7 @@ import { useNextFlag, useOffsetOverview, useProgressOverview, - useRundownOverview, + useStartTimesOverview, useTimer, } from '../../../common/hooks/useSocket'; import { useEntry } from '../../../common/hooks-query/useRundown'; @@ -34,7 +34,7 @@ import { OverUnder, TimeColumn } from './TimeLayout'; import style from './TimeElements.module.scss'; export function StartTimes() { - const { plannedEnd, plannedStart, actualStart, expectedEnd } = useRundownOverview(); + const { plannedEnd, plannedStart, actualStart, expectedEnd } = useStartTimesOverview(); const plannedStartText = plannedStart === null ? timerPlaceholder : formatTime(plannedStart); diff --git a/apps/client/src/views/studio/StudioTimers.tsx b/apps/client/src/views/studio/StudioTimers.tsx index 53915da04..1aafec4e2 100644 --- a/apps/client/src/views/studio/StudioTimers.tsx +++ b/apps/client/src/views/studio/StudioTimers.tsx @@ -17,12 +17,12 @@ interface StudioTimersProps { export default function StudioTimers({ viewSettings }: StudioTimersProps) { const { getLocalizedString } = useTranslation(); - const { eventNow, eventNext, message, time, offset, rundown } = useStudioTimersSocket(); + const { eventNow, eventNext, message, time, offset, rundown, expectedRundownEnd } = useStudioTimersSocket(); const schedule = getFormattedScheduleTimes({ - offset: offset.absolute, + offset: offset, actualStart: rundown.actualStart, - expectedEnd: offset.expectedRundownEnd, + expectedEnd: expectedRundownEnd, }); const event = getFormattedEventData(eventNow, time); const eventNextTitle = eventNext?.title || '-'; @@ -37,7 +37,7 @@ export default function StudioTimers({ viewSettings }: StudioTimersProps) { time.phase === TimerPhase.Danger, ); - const offsetState = getOffsetState(offset.absolute); + const offsetState = getOffsetState(offset); return (