diff --git a/src/features/MatchPage/store/hooks/index.tsx b/src/features/MatchPage/store/hooks/index.tsx index d4438600..f748a7c2 100644 --- a/src/features/MatchPage/store/hooks/index.tsx +++ b/src/features/MatchPage/store/hooks/index.tsx @@ -175,7 +175,12 @@ export const useMatchPage = () => { ]) useEffect(() => { - getMatchInfo(sportType, matchId).then(setMatchProfile) + getMatchInfo(sportType, matchId).then( + (info) => (info?.sport + // проверяем именно какой-то ключ в объекте, + // потому что, когда матча не существует, приходит - [] + ? setMatchProfile(info) : window.location.replace(PAGES.home)), + ) }, [sportType, matchId]) useEffect(() => {