mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-14 20:03:52 +00:00
refactor: invert offset
This commit is contained in:
committed by
Carlos Valente
parent
8b5034efbf
commit
8da8a08464
@@ -116,7 +116,7 @@ function RuntimeOverview() {
|
||||
const { clock, offset } = useRuntimePlaybackOverview();
|
||||
|
||||
const offsetText = getOffsetText(offset);
|
||||
const offsetClasses = offset === null ? undefined : offset > 0 ? style.behind : style.ahead;
|
||||
const offsetClasses = offset === null ? undefined : offset <= 0 ? style.behind : style.ahead;
|
||||
|
||||
return (
|
||||
<>
|
||||
|
||||
@@ -38,10 +38,5 @@ export function getOffsetText(offset: MaybeNumber): string {
|
||||
if (offset === null) {
|
||||
return enDash;
|
||||
}
|
||||
const isAhead = offset <= 0;
|
||||
let offsetText = millisToString(Math.abs(offset), { fallback: enDash });
|
||||
if (offsetText !== enDash) {
|
||||
offsetText = isAhead ? `+${offsetText}` : `${enDash}${offsetText}`;
|
||||
}
|
||||
return offsetText;
|
||||
return millisToString(offset, { fallback: enDash });
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user