mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-19 22:24:11 +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) => ({
|
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: {
|
||||||
|
|||||||
@@ -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 };
|
||||||
|
|||||||
Reference in New Issue
Block a user