mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-21 15:09:10 +00:00
refactor: omit modifier in timer type none
This commit is contained in:
committed by
Carlos Valente
parent
6e8734c73f
commit
597be4e710
@@ -122,10 +122,11 @@ export default function MinimalTimer(props: MinimalTimerProps) {
|
|||||||
|
|
||||||
const isPlaying = time.playback !== Playback.Pause;
|
const isPlaying = time.playback !== Playback.Pause;
|
||||||
|
|
||||||
const shouldShowModifiers = time.timerType !== TimerType.Clock && time.timerType !== TimerType.CountUp;
|
const shouldShowModifiers = time.timerType === TimerType.CountDown || time.timerType === TimerType.TimeToEnd;
|
||||||
const finished = time.phase === TimerPhase.Overtime;
|
const finished = time.phase === TimerPhase.Overtime;
|
||||||
const showEndMessage = finished && viewSettings.endMessage && !hideEndMessage;
|
const showEndMessage = shouldShowModifiers && finished && viewSettings.endMessage && !hideEndMessage;
|
||||||
const showFinished = finished && !userOptions?.hideOvertime && (shouldShowModifiers || showEndMessage);
|
const showFinished =
|
||||||
|
shouldShowModifiers && finished && !userOptions?.hideOvertime && (shouldShowModifiers || showEndMessage);
|
||||||
|
|
||||||
const showProgress = time.playback !== Playback.Stop;
|
const showProgress = time.playback !== Playback.Stop;
|
||||||
const showWarning = shouldShowModifiers && time.phase === TimerPhase.Warning;
|
const showWarning = shouldShowModifiers && time.phase === TimerPhase.Warning;
|
||||||
|
|||||||
@@ -114,10 +114,10 @@ export default function Timer(props: TimerProps) {
|
|||||||
const finished = time.phase === TimerPhase.Overtime;
|
const finished = time.phase === TimerPhase.Overtime;
|
||||||
const totalTime = (time.duration ?? 0) + (time.addedTime ?? 0);
|
const totalTime = (time.duration ?? 0) + (time.addedTime ?? 0);
|
||||||
|
|
||||||
const shouldShowModifiers = time.timerType !== TimerType.Clock && time.timerType !== TimerType.CountUp;
|
const shouldShowModifiers = time.timerType === TimerType.CountDown || time.timerType === TimerType.TimeToEnd;
|
||||||
const showEndMessage = finished && viewSettings.endMessage;
|
const showEndMessage = shouldShowModifiers && finished && viewSettings.endMessage;
|
||||||
const showProgress = time.playback !== Playback.Stop;
|
const showProgress = time.playback !== Playback.Stop;
|
||||||
const showFinished = finished && (shouldShowModifiers || showEndMessage);
|
const showFinished = shouldShowModifiers && finished && (shouldShowModifiers || showEndMessage);
|
||||||
const showWarning = shouldShowModifiers && time.phase === TimerPhase.Warning;
|
const showWarning = shouldShowModifiers && time.phase === TimerPhase.Warning;
|
||||||
const showDanger = shouldShowModifiers && time.phase === TimerPhase.Danger;
|
const showDanger = shouldShowModifiers && time.phase === TimerPhase.Danger;
|
||||||
const showClock = time.timerType !== TimerType.Clock;
|
const showClock = time.timerType !== TimerType.Clock;
|
||||||
|
|||||||
Reference in New Issue
Block a user