mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-07 00:13:53 +00:00
chore: cleanup
This commit is contained in:
@@ -272,5 +272,5 @@ export const useStudioTimersSocket = createSelector((state: RuntimeStore) => ({
|
||||
|
||||
export const useTimelineSocket = createSelector((state: RuntimeStore) => ({
|
||||
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) {
|
||||
const { getLocalizedString } = useTranslation();
|
||||
const { clock, offsetAbs } = useTimelineSocket();
|
||||
const { clock, offset } = useTimelineSocket();
|
||||
|
||||
// gather card data
|
||||
const titleNow = now?.title ?? '-';
|
||||
@@ -26,7 +26,7 @@ export default function TimelineSections({ now, next, followedBy }: TimelineSect
|
||||
let followedByStatus: string | undefined;
|
||||
|
||||
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) {
|
||||
nextStatus = dueText;
|
||||
} else {
|
||||
@@ -35,7 +35,7 @@ export default function TimelineSections({ now, next, followedBy }: TimelineSect
|
||||
}
|
||||
|
||||
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) {
|
||||
followedByStatus = dueText;
|
||||
} else {
|
||||
|
||||
@@ -1011,7 +1011,7 @@ describe('getRuntimeOffset()', () => {
|
||||
});
|
||||
});
|
||||
|
||||
describe('getoffsetRel()', () => {
|
||||
describe('getRuntimeOffset() relative', () => {
|
||||
it('relative offset is 0 when starting at the planed time', () => {
|
||||
const state = {
|
||||
eventNow: {
|
||||
|
||||
@@ -106,14 +106,11 @@ export function clearEventData() {
|
||||
runtimeState.offset.absolute = 0;
|
||||
runtimeState.offset.relative = 0;
|
||||
runtimeState.offset.expectedFlagStart = null;
|
||||
runtimeState.offset.expectedGroupEnd = null;
|
||||
runtimeState.offset.expectedRundownEnd = 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.clock = timeNow();
|
||||
runtimeState.timer = { ...runtimeStorePlaceholder.timer };
|
||||
|
||||
Reference in New Issue
Block a user