|
|
|
|
@ -8,12 +8,13 @@ import includes from 'lodash/includes' |
|
|
|
|
import filter from 'lodash/filter' |
|
|
|
|
import isEmpty from 'lodash/isEmpty' |
|
|
|
|
|
|
|
|
|
import { useToggle } from 'hooks' |
|
|
|
|
import { FULL_GAME_KEY } from 'features/MatchPage/helpers/buildPlaylists' |
|
|
|
|
|
|
|
|
|
import type { MatchInfo } from 'requests/getMatchInfo' |
|
|
|
|
import { getMatchInfo } from 'requests/getMatchInfo' |
|
|
|
|
|
|
|
|
|
import { usePageParams } from 'hooks/usePageParams' |
|
|
|
|
import { useToggle } from 'hooks/useToggle' |
|
|
|
|
|
|
|
|
|
import { parseDate } from 'helpers/parseDate' |
|
|
|
|
|
|
|
|
|
@ -63,6 +64,17 @@ export const useMatchPage = () => { |
|
|
|
|
return () => clearInterval(getIntervalMatch) |
|
|
|
|
}, [matchProfile, sportType, matchId]) |
|
|
|
|
|
|
|
|
|
useEffect(() => { |
|
|
|
|
let getIntervalMatch: ReturnType<typeof setInterval> |
|
|
|
|
if (matchProfile?.live && selectedPlaylist?.id === FULL_GAME_KEY |
|
|
|
|
) { |
|
|
|
|
getIntervalMatch = setInterval( |
|
|
|
|
() => getMatchInfo(sportType, matchId).then(setMatchProfile), 5000, |
|
|
|
|
) |
|
|
|
|
} |
|
|
|
|
return () => clearInterval(getIntervalMatch) |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
const { |
|
|
|
|
events, |
|
|
|
|
handlePlaylistClick, |
|
|
|
|
|