fix(#560): check matchProfile in matchPage #186

Merged
andrey.dekterev merged 1 commits from IN-560-doesnt-exist-match into develop 3 years ago
  1. 7
      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(() => {

Loading…
Cancel
Save