Fix TS error: narrow picksExpiresAt via optional chain guard
All checks were successful
🚀 Deploy / 🧪 Test (pull_request) Successful in 2m33s
🚀 Deploy / ʦ🔍 Typecheck & Lint (pull_request) Successful in 1m21s
🚀 Deploy / 🐳 Build (pull_request) Has been skipped
🚀 Deploy / 🚀 Deploy (pull_request) Has been skipped

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Chris Parsons 2026-06-06 00:25:23 -07:00
parent a91c108393
commit a4317815f7

View file

@ -508,7 +508,7 @@ export default function DraftRoom() {
// loaderTimerNow is server-side Date.now() — subtract from server expiresAt to get ms remaining // loaderTimerNow is server-side Date.now() — subtract from server expiresAt to get ms remaining
// without skew, then re-anchor to client clock. // without skew, then re-anchor to client clock.
const active = timers.find((t) => t.picksExpiresAt && t.picksExpiresAt.getTime() > loaderTimerNow); const active = timers.find((t) => t.picksExpiresAt && t.picksExpiresAt.getTime() > loaderTimerNow);
if (!active) return null; if (!active?.picksExpiresAt) return null;
const secondsRemaining = Math.ceil((active.picksExpiresAt.getTime() - loaderTimerNow) / 1000); const secondsRemaining = Math.ceil((active.picksExpiresAt.getTime() - loaderTimerNow) / 1000);
return { teamId: active.teamId, expiresAt: Date.now() + secondsRemaining * 1000 }; return { teamId: active.teamId, expiresAt: Date.now() + secondsRemaining * 1000 };
}); });