From 6d1a911ab8e4b207f02dd7bb0bc29e8ff9e7854d Mon Sep 17 00:00:00 2001 From: Carlos Valente Date: Tue, 4 Jun 2024 15:34:43 +0200 Subject: [PATCH] refactor: rename negative to overtime --- .../control/playback/playback-timer/PlaybackTimer.tsx | 2 +- .../src/features/viewers/minimal-timer/MinimalTimer.tsx | 2 +- apps/client/src/features/viewers/timer/Timer.tsx | 2 +- apps/server/src/services/__tests__/timerUtils.test.ts | 4 ++-- apps/server/src/services/timerUtils.ts | 2 +- packages/types/src/definitions/runtime/TimerState.type.ts | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/apps/client/src/features/control/playback/playback-timer/PlaybackTimer.tsx b/apps/client/src/features/control/playback/playback-timer/PlaybackTimer.tsx index cdc315311..c3949eaf0 100644 --- a/apps/client/src/features/control/playback/playback-timer/PlaybackTimer.tsx +++ b/apps/client/src/features/control/playback/playback-timer/PlaybackTimer.tsx @@ -44,7 +44,7 @@ export default function PlaybackTimer(props: PropsWithChildren 0 && timer.current === null; - const isOvertime = timer.phase === TimerPhase.Negative; + const isOvertime = timer.phase === TimerPhase.Overtime; const hasAddedTime = Boolean(timer.addedTime); const rollLabel = isRolling ? 'Roll mode active' : ''; diff --git a/apps/client/src/features/viewers/minimal-timer/MinimalTimer.tsx b/apps/client/src/features/viewers/minimal-timer/MinimalTimer.tsx index 56ee2c15f..673dca07c 100644 --- a/apps/client/src/features/viewers/minimal-timer/MinimalTimer.tsx +++ b/apps/client/src/features/viewers/minimal-timer/MinimalTimer.tsx @@ -127,7 +127,7 @@ export default function MinimalTimer(props: MinimalTimerProps) { const isPlaying = time.playback !== Playback.Pause; const shouldShowModifiers = time.timerType !== TimerType.Clock && time.timerType !== TimerType.CountUp; - const finished = time.phase === TimerPhase.Negative; + const finished = time.phase === TimerPhase.Overtime; const showEndMessage = finished && viewSettings.endMessage && !hideEndMessage; const showFinished = finished && !userOptions?.hideOvertime && (shouldShowModifiers || showEndMessage); diff --git a/apps/client/src/features/viewers/timer/Timer.tsx b/apps/client/src/features/viewers/timer/Timer.tsx index 924de057d..981777d9a 100644 --- a/apps/client/src/features/viewers/timer/Timer.tsx +++ b/apps/client/src/features/viewers/timer/Timer.tsx @@ -111,7 +111,7 @@ export default function Timer(props: TimerProps) { const timerIsTimeOfDay = time.timerType === TimerType.Clock; - const finished = time.phase === TimerPhase.Negative; + const finished = time.phase === TimerPhase.Overtime; const totalTime = (time.duration ?? 0) + (time.addedTime ?? 0); const shouldShowModifiers = time.timerType !== TimerType.Clock && time.timerType !== TimerType.CountUp; diff --git a/apps/server/src/services/__tests__/timerUtils.test.ts b/apps/server/src/services/__tests__/timerUtils.test.ts index aa3bb7a66..480e7b828 100644 --- a/apps/server/src/services/__tests__/timerUtils.test.ts +++ b/apps/server/src/services/__tests__/timerUtils.test.ts @@ -1779,7 +1779,7 @@ describe('getTimerPhase()', () => { expect(phase).toBe(TimerPhase.None); }); - it('can be negative', () => { + it('can be in overtime', () => { const state = { timer: { addedTime: 0, @@ -1794,7 +1794,7 @@ describe('getTimerPhase()', () => { } as RuntimeState; const phase = getTimerPhase(state); - expect(phase).toBe(TimerPhase.Negative); + expect(phase).toBe(TimerPhase.Overtime); }); it('can be danger', () => { diff --git a/apps/server/src/services/timerUtils.ts b/apps/server/src/services/timerUtils.ts index 487b36e17..6237f8fe1 100644 --- a/apps/server/src/services/timerUtils.ts +++ b/apps/server/src/services/timerUtils.ts @@ -391,7 +391,7 @@ export function getTimerPhase(state: RuntimeState): TimerPhase { } if (current < 0) { - return TimerPhase.Negative; + return TimerPhase.Overtime; } const danger = state.eventNow.timeDanger; diff --git a/packages/types/src/definitions/runtime/TimerState.type.ts b/packages/types/src/definitions/runtime/TimerState.type.ts index 59f98769f..234f8aa00 100644 --- a/packages/types/src/definitions/runtime/TimerState.type.ts +++ b/packages/types/src/definitions/runtime/TimerState.type.ts @@ -6,7 +6,7 @@ export enum TimerPhase { Default = 'default', Warning = 'warning', Danger = 'danger', - Negative = 'negative', + Overtime = 'overtime', Pending = 'pending', // used for waiting to roll }