chore: cleanup

This commit is contained in:
arc-alex
2025-08-14 19:30:08 +02:00
committed by Carlos Valente
parent 048a9c96ea
commit db922a67e2
4 changed files with 7 additions and 10 deletions
+1 -1
View File
@@ -272,5 +272,5 @@ export const useStudioTimersSocket = createSelector((state: RuntimeStore) => ({
export const useTimelineSocket = createSelector((state: RuntimeStore) => ({ export const useTimelineSocket = createSelector((state: RuntimeStore) => ({
clock: state.clock, clock: state.clock,
offsetAbs: state.offset.absolute, offset: state.offset.absolute,
})); }));
@@ -15,7 +15,7 @@ interface TimelineSectionsProps {
export default function TimelineSections({ now, next, followedBy }: TimelineSectionsProps) { export default function TimelineSections({ now, next, followedBy }: TimelineSectionsProps) {
const { getLocalizedString } = useTranslation(); const { getLocalizedString } = useTranslation();
const { clock, offsetAbs } = useTimelineSocket(); const { clock, offset } = useTimelineSocket();
// gather card data // gather card data
const titleNow = now?.title ?? '-'; const titleNow = now?.title ?? '-';
@@ -26,7 +26,7 @@ export default function TimelineSections({ now, next, followedBy }: TimelineSect
let followedByStatus: string | undefined; let followedByStatus: string | undefined;
if (next !== null) { if (next !== null) {
const timeToStart = getTimeToStart(clock, next.timeStart, next?.delay ?? 0, offsetAbs); const timeToStart = getTimeToStart(clock, next.timeStart, next?.delay ?? 0, offset);
if (timeToStart < 0) { if (timeToStart < 0) {
nextStatus = dueText; nextStatus = dueText;
} else { } else {
@@ -35,7 +35,7 @@ export default function TimelineSections({ now, next, followedBy }: TimelineSect
} }
if (followedBy !== null) { if (followedBy !== null) {
const timeToStart = getTimeToStart(clock, followedBy.timeStart, followedBy?.delay ?? 0, offsetAbs); const timeToStart = getTimeToStart(clock, followedBy.timeStart, followedBy?.delay ?? 0, offset);
if (timeToStart < 0) { if (timeToStart < 0) {
followedByStatus = dueText; followedByStatus = dueText;
} else { } else {
@@ -1011,7 +1011,7 @@ describe('getRuntimeOffset()', () => {
}); });
}); });
describe('getoffsetRel()', () => { describe('getRuntimeOffset() relative', () => {
it('relative offset is 0 when starting at the planed time', () => { it('relative offset is 0 when starting at the planed time', () => {
const state = { const state = {
eventNow: { eventNow: {
+2 -5
View File
@@ -106,14 +106,11 @@ export function clearEventData() {
runtimeState.offset.absolute = 0; runtimeState.offset.absolute = 0;
runtimeState.offset.relative = 0; runtimeState.offset.relative = 0;
runtimeState.offset.expectedFlagStart = null; runtimeState.offset.expectedFlagStart = null;
runtimeState.offset.expectedGroupEnd = null;
runtimeState.offset.expectedRundownEnd = null;
runtimeState.rundown.selectedEventIndex = null; runtimeState.rundown.selectedEventIndex = null;
//TODO: is there any ExpectedMetadata stuff we need to clear here
runtimeState.offset.expectedGroupEnd = null;
runtimeState.offset.expectedFlagStart = null;
runtimeState.offset.expectedRundownEnd = null;
runtimeState.timer.playback = Playback.Stop; runtimeState.timer.playback = Playback.Stop;
runtimeState.clock = timeNow(); runtimeState.clock = timeNow();
runtimeState.timer = { ...runtimeStorePlaceholder.timer }; runtimeState.timer = { ...runtimeStorePlaceholder.timer };