From f2c12bed8c639099a4b3ef5904fe78fd430c5563 Mon Sep 17 00:00:00 2001 From: Andrei Dekterev Date: Thu, 9 Feb 2023 19:39:10 +0700 Subject: [PATCH] fix(fix-show-matches): fix filtered matches --- src/features/MatchesGrid/index.tsx | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/features/MatchesGrid/index.tsx b/src/features/MatchesGrid/index.tsx index fbefccf6..04138cae 100644 --- a/src/features/MatchesGrid/index.tsx +++ b/src/features/MatchesGrid/index.tsx @@ -41,9 +41,16 @@ export const MatchesGrid = memo(({ matches }: MatchesGridProps) => { || selectedLeague[0] === 'all_competitions'))) } - return matches.filter((match) => compareSport(match, selectedSport)) + if (isHomePage && selectedSport) { + return matches.filter((match) => compareSport(match, selectedSport)) + } + + return matches } + useEffect(() => { + if (!isHomePage) return + updateSportIds(matches) // eslint-disable-next-line react-hooks/exhaustive-deps }, [selectedDate, matches])