diff --git a/app/components/tournament/CheckinActions.tsx b/app/components/tournament/CheckinActions.tsx index 6d9211776..7ba6ff813 100644 --- a/app/components/tournament/CheckinActions.tsx +++ b/app/components/tournament/CheckinActions.tsx @@ -31,6 +31,14 @@ export function CheckinActions() { const [minutesTillCheckInCloses, setMinutesTillCheckInCloses] = React.useState(timeInMinutesBeforeCheckInCloses()); + React.useEffect(() => { + const timeout = setInterval(() => { + setMinutesTillCheckInCloses(timeInMinutesBeforeCheckInCloses()); + }, 1000 * 15); + + return () => clearTimeout(timeout); + }, []); + const ownTeam = tournament.teams.find((team) => team.members.some( ({ member, captain }) => captain && member.id === user?.id @@ -42,14 +50,6 @@ export function CheckinActions() { return null; } - React.useEffect(() => { - const timeout = setInterval(() => { - setMinutesTillCheckInCloses(timeInMinutesBeforeCheckInCloses()); - }, 1000 * 15); - - return () => clearTimeout(timeout); - }, []); - if (ownTeam.checkedInTime) { return (