refactor: improve typing in backend (#748)

This commit is contained in:
Carlos Valente
2024-01-30 21:12:19 +01:00
committed by GitHub
parent 39711c1edd
commit 6a5020424b
26 changed files with 703 additions and 147 deletions
+2 -4
View File
@@ -15,9 +15,8 @@ export const normaliseEndTime = (start: number, end: number) => (end < start ? e
*/
export function getExpectedFinish(state: TState): MaybeNumber {
const { startedAt, finishedAt, duration, addedTime } = state.timer;
const { timerType } = state.eventNow;
const { timerType, timeEnd } = state.eventNow;
const { pausedAt } = state._timer;
const { timeEnd } = state.eventNow;
const { clock } = state;
if (startedAt === null) {
@@ -51,9 +50,8 @@ export function getExpectedFinish(state: TState): MaybeNumber {
*/
export function getCurrent(state: TState): number {
const { startedAt, duration, addedTime } = state.timer;
const { timerType } = state.eventNow;
const { timerType, timeEnd } = state.eventNow;
const { pausedAt } = state._timer;
const { timeEnd } = state.eventNow;
const { clock } = state;
if (timerType === TimerType.TimeToEnd) {