Fix lint: use nowForPauseCheck instead of Date.now() in room closure countdown
This commit is contained in:
parent
c80ca468a5
commit
7780f9bc29
1 changed files with 1 additions and 1 deletions
|
|
@ -278,7 +278,7 @@ export default function DraftRoom() {
|
||||||
if (!isDraftComplete) return null;
|
if (!isDraftComplete) return null;
|
||||||
const completedAt = season.draftCompletedAt;
|
const completedAt = season.draftCompletedAt;
|
||||||
if (!completedAt) return 300;
|
if (!completedAt) return 300;
|
||||||
const elapsed = (Date.now() - completedAt.getTime()) / 1000;
|
const elapsed = (nowForPauseCheck.getTime() - completedAt.getTime()) / 1000;
|
||||||
const remaining = Math.max(0, 300 - elapsed);
|
const remaining = Math.max(0, 300 - elapsed);
|
||||||
return Math.ceil(remaining);
|
return Math.ceil(remaining);
|
||||||
}, [isDraftComplete, season.draftCompletedAt, nowForPauseCheck]);
|
}, [isDraftComplete, season.draftCompletedAt, nowForPauseCheck]);
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue