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 (
!isBefore(tournamentDate, startDate) &&
(endDate === undefined ||
(!isAfter(tournamentDate, endDate) &&
!tournament.pending &&
tournament.status === "scheduled" &&
((tournament.timeControl === TimeControl.Classic && classic) ||
(tournament.timeControl === TimeControl.Rapid && rapid) ||
(tournament.timeControl === TimeControl.Blitz && blitz) ||
(tournament.timeControl === TimeControl.Other && other))))
(endDate === undefined || !isAfter(tournamentDate, endDate)) &&
!tournament.pending &&
tournament.status === "scheduled" &&
((tournament.timeControl === TimeControl.Classic && classic) ||
(tournament.timeControl === TimeControl.Rapid && rapid) ||
(tournament.timeControl === TimeControl.Blitz && blitz) ||
(tournament.timeControl === TimeControl.Other && other))
);
});