mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-13 19:33:46 +00:00
chore: rename time-to-end to count-to-end
This commit is contained in:
committed by
Carlos Valente
parent
c9ef2465f8
commit
2f2c26ed00
@@ -19,7 +19,7 @@ export function getExpectedFinish(state: RuntimeState): MaybeNumber {
|
||||
return null;
|
||||
}
|
||||
|
||||
const { isTimeToEnd, timeEnd } = state.eventNow;
|
||||
const { countToEnd, timeEnd } = state.eventNow;
|
||||
const { pausedAt } = state._timer;
|
||||
const { clock } = state;
|
||||
|
||||
@@ -33,7 +33,7 @@ export function getExpectedFinish(state: RuntimeState): MaybeNumber {
|
||||
|
||||
const pausedTime = pausedAt != null ? clock - pausedAt : 0;
|
||||
|
||||
if (isTimeToEnd) {
|
||||
if (countToEnd) {
|
||||
return timeEnd + addedTime + pausedTime;
|
||||
}
|
||||
|
||||
@@ -62,11 +62,11 @@ export function getCurrent(state: RuntimeState): number {
|
||||
}
|
||||
}
|
||||
const { startedAt, duration, addedTime } = state.timer;
|
||||
const { isTimeToEnd, timeStart, timeEnd } = state.eventNow;
|
||||
const { countToEnd, timeStart, timeEnd } = state.eventNow;
|
||||
const { pausedAt } = state._timer;
|
||||
const { clock } = state;
|
||||
|
||||
if (isTimeToEnd) {
|
||||
if (countToEnd) {
|
||||
const isEventOverMidnight = timeStart > timeEnd;
|
||||
const correctDay = isEventOverMidnight ? dayInMs : 0;
|
||||
return correctDay - clock + timeEnd + addedTime;
|
||||
@@ -131,7 +131,7 @@ export function getRuntimeOffset(state: RuntimeState): number {
|
||||
}
|
||||
|
||||
const { clock } = state;
|
||||
const { isTimeToEnd, timeStart } = state.eventNow;
|
||||
const { countToEnd, timeStart } = state.eventNow;
|
||||
const { addedTime, current, startedAt } = state.timer;
|
||||
|
||||
// if we havent started, but the timer is armed
|
||||
@@ -142,7 +142,7 @@ export function getRuntimeOffset(state: RuntimeState): number {
|
||||
|
||||
const overtime = Math.min(current, 0);
|
||||
// in time-to-end, offset is overtime
|
||||
if (isTimeToEnd) {
|
||||
if (countToEnd) {
|
||||
return overtime;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user