Fix the time control filters

This commit is contained in:
Timothy Armes
2024-05-11 12:56:38 +02:00
parent ae532b2a3c
commit 38edadd591
+7 -8
View File
@@ -59,14 +59,13 @@ export const filteredTournamentsByTimeControlAtom = atom((get) => {
return ( return (
!isBefore(tournamentDate, startDate) && !isBefore(tournamentDate, startDate) &&
(endDate === undefined || (endDate === undefined || !isAfter(tournamentDate, endDate)) &&
(!isAfter(tournamentDate, endDate) && !tournament.pending &&
!tournament.pending && tournament.status === "scheduled" &&
tournament.status === "scheduled" && ((tournament.timeControl === TimeControl.Classic && classic) ||
((tournament.timeControl === TimeControl.Classic && classic) || (tournament.timeControl === TimeControl.Rapid && rapid) ||
(tournament.timeControl === TimeControl.Rapid && rapid) || (tournament.timeControl === TimeControl.Blitz && blitz) ||
(tournament.timeControl === TimeControl.Blitz && blitz) || (tournament.timeControl === TimeControl.Other && other))
(tournament.timeControl === TimeControl.Other && other))))
); );
}); });