fix(call-to-play): extend from the current deadline
Pass the effective nomination deadline into the Add time action and extend from whichever is later: that deadline or the current time. This preserves remaining time when a call becomes ready early while still giving an overdue call a fresh five-minute window. Test Plan: - just fmt - just frontend-test - just build - git diff --cached --check
This commit is contained in:
@@ -9,6 +9,12 @@ export const CHECKIN_LEAD_MS = 15 * 60_000;
|
||||
export const EXPIRED_RETENTION_MS = 5 * 60_000;
|
||||
export const TERMINAL_RETENTION_MS = 15 * 60_000;
|
||||
|
||||
export const extendDeadline = (
|
||||
now: number,
|
||||
currentDeadline: number,
|
||||
durationMinutes = 5,
|
||||
): number => Math.max(now, currentDeadline) + durationMinutes * 60_000;
|
||||
|
||||
export type CallToPlayPhase = 'now' | 'scheduled' | 'checkin';
|
||||
export type CallToPlayStatus =
|
||||
| 'running'
|
||||
|
||||
Reference in New Issue
Block a user