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,
}));
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,
}));
@@ -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);
@@ -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 (
<div className='studio__timers'>