diff --git a/apps/client/src/common/hooks/useSocket.ts b/apps/client/src/common/hooks/useSocket.ts index 0373f077f..3bfbb92c5 100644 --- a/apps/client/src/common/hooks/useSocket.ts +++ b/apps/client/src/common/hooks/useSocket.ts @@ -230,7 +230,6 @@ export const useOffsetOverview = createSelector((state: RuntimeStore) => ({ export const useGroupTimerOverView = createSelector((state: RuntimeStore) => ({ clock: state.clock, - offset: state.offset.mode === OffsetMode.Absolute ? state.offset.absolute : state.offset.relative, mode: state.offset.mode, groupExpectedEnd: state.offset.expectedGroupEnd, // we can force these numbers to 0 fo this use case to avoid null checks diff --git a/apps/client/src/features/overview/composite/TimeElements.tsx b/apps/client/src/features/overview/composite/TimeElements.tsx index 25c1e61a0..17ee75868 100644 --- a/apps/client/src/features/overview/composite/TimeElements.tsx +++ b/apps/client/src/features/overview/composite/TimeElements.tsx @@ -100,7 +100,7 @@ export function MetadataTimes() { } function GroupTimes() { - const { clock, groupExpectedEnd, actualGroupStart, mode, playback, currentDay } = useGroupTimerOverView(); + const { clock, mode, groupExpectedEnd, actualGroupStart, currentDay, playback } = useGroupTimerOverView(); const { currentGroupId } = useCurrentGroupId(); const group = useEntry(currentGroupId) as OntimeGroup | null; @@ -111,6 +111,7 @@ function GroupTimes() { if (!active) return null; if (!group || group.timeStart === null) return null; const normalizedClock = clock + currentDay * dayInMs; + return mode === OffsetMode.Absolute ? group.timeStart + group.duration - normalizedClock : actualGroupStart + group.duration - normalizedClock; @@ -121,11 +122,9 @@ function GroupTimes() { const expectedGroupEnd = groupExpectedEnd !== null ? groupExpectedEnd - clock : null; const expectedTimeUntilGroupEnd = formatDueTime(expectedGroupEnd, 3, TimerType.CountDown); - const groupTitle = group?.title ?? null; - return (