All views follow offset mode (#1808)

* chore: remove unused

* fix: studio view follow offset mode
This commit is contained in:
Alex Christoffer Rasmussen
2025-10-07 12:11:14 +02:00
parent fc7ed6bd20
commit 57315595a5
3 changed files with 9 additions and 26 deletions
+3 -20
View File
@@ -164,11 +164,6 @@ export const useProgressData = createSelector((state: RuntimeStore) => ({
timeDanger: state.eventNow?.timeDanger ?? null, timeDanger: state.eventNow?.timeDanger ?? null,
})); }));
export const useTimelineStatus = createSelector((state: RuntimeStore) => ({
clock: state.clock,
offset: state.offset.absolute,
}));
export const useExpectedStartData = createSelector((state: RuntimeStore) => ({ export const useExpectedStartData = createSelector((state: RuntimeStore) => ({
offset: state.offset.mode === OffsetMode.Absolute ? state.offset.absolute : state.offset.relative, offset: state.offset.mode === OffsetMode.Absolute ? state.offset.absolute : state.offset.relative,
mode: state.offset.mode, mode: state.offset.mode,
@@ -178,14 +173,6 @@ export const useExpectedStartData = createSelector((state: RuntimeStore) => ({
clock: state.clock, 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) => ({ export const usePing = createSelector((state: RuntimeStore) => ({
ping: state.ping, ping: state.ping,
})); }));
@@ -211,7 +198,7 @@ export const usePlayback = () => {
/* ======================= Overview data subscriptions ======================= */ /* ======================= Overview data subscriptions ======================= */
export const useRundownOverview = createSelector((state: RuntimeStore) => ({ export const useStartTimesOverview = createSelector((state: RuntimeStore) => ({
plannedStart: state.rundown.plannedStart, plannedStart: state.rundown.plannedStart,
actualStart: state.rundown.actualStart, actualStart: state.rundown.actualStart,
plannedEnd: state.rundown.plannedEnd, plannedEnd: state.rundown.plannedEnd,
@@ -289,11 +276,7 @@ export const useStudioTimersSocket = createSelector((state: RuntimeStore) => ({
eventNow: state.eventNow, eventNow: state.eventNow,
message: state.message, message: state.message,
time: state.timer, time: state.timer,
offset: state.offset, offset: state.offset.mode === OffsetMode.Absolute ? state.offset.absolute : state.offset.relative,
rundown: state.rundown, rundown: state.rundown,
})); expectedRundownEnd: state.offset.expectedRundownEnd,
export const useTimelineSocket = createSelector((state: RuntimeStore) => ({
clock: state.clock,
offset: state.offset.absolute,
})); }));
@@ -20,7 +20,7 @@ import {
useNextFlag, useNextFlag,
useOffsetOverview, useOffsetOverview,
useProgressOverview, useProgressOverview,
useRundownOverview, useStartTimesOverview,
useTimer, useTimer,
} from '../../../common/hooks/useSocket'; } from '../../../common/hooks/useSocket';
import { useEntry } from '../../../common/hooks-query/useRundown'; import { useEntry } from '../../../common/hooks-query/useRundown';
@@ -34,7 +34,7 @@ import { OverUnder, TimeColumn } from './TimeLayout';
import style from './TimeElements.module.scss'; import style from './TimeElements.module.scss';
export function StartTimes() { export function StartTimes() {
const { plannedEnd, plannedStart, actualStart, expectedEnd } = useRundownOverview(); const { plannedEnd, plannedStart, actualStart, expectedEnd } = useStartTimesOverview();
const plannedStartText = plannedStart === null ? timerPlaceholder : formatTime(plannedStart); const plannedStartText = plannedStart === null ? timerPlaceholder : formatTime(plannedStart);
@@ -17,12 +17,12 @@ interface StudioTimersProps {
export default function StudioTimers({ viewSettings }: StudioTimersProps) { export default function StudioTimers({ viewSettings }: StudioTimersProps) {
const { getLocalizedString } = useTranslation(); const { getLocalizedString } = useTranslation();
const { eventNow, eventNext, message, time, offset, rundown } = useStudioTimersSocket(); const { eventNow, eventNext, message, time, offset, rundown, expectedRundownEnd } = useStudioTimersSocket();
const schedule = getFormattedScheduleTimes({ const schedule = getFormattedScheduleTimes({
offset: offset.absolute, offset: offset,
actualStart: rundown.actualStart, actualStart: rundown.actualStart,
expectedEnd: offset.expectedRundownEnd, expectedEnd: expectedRundownEnd,
}); });
const event = getFormattedEventData(eventNow, time); const event = getFormattedEventData(eventNow, time);
const eventNextTitle = eventNext?.title || '-'; const eventNextTitle = eventNext?.title || '-';
@@ -37,7 +37,7 @@ export default function StudioTimers({ viewSettings }: StudioTimersProps) {
time.phase === TimerPhase.Danger, time.phase === TimerPhase.Danger,
); );
const offsetState = getOffsetState(offset.absolute); const offsetState = getOffsetState(offset);
return ( return (
<div className='studio__timers'> <div className='studio__timers'>