|
|
|
@ -42,15 +42,13 @@ export const useMatchProfile = () => { |
|
|
|
}, [sportType, matchId]) |
|
|
|
}, [sportType, matchId]) |
|
|
|
|
|
|
|
|
|
|
|
useEffect(() => { |
|
|
|
useEffect(() => { |
|
|
|
let getIntervalMatch |
|
|
|
let getIntervalMatch: ReturnType<typeof setInterval> |
|
|
|
if (matchProfile?.live && !matchProfile.youtube_link) { |
|
|
|
if (matchProfile?.live && !matchProfile.youtube_link) { |
|
|
|
getIntervalMatch = setInterval( |
|
|
|
getIntervalMatch = setInterval( |
|
|
|
() => getMatchInfo(sportType, matchId).then(setMatchProfile), 1000 * 60 * 3, |
|
|
|
() => getMatchInfo(sportType, matchId).then(setMatchProfile), 1000 * 60 * 3, |
|
|
|
) |
|
|
|
) |
|
|
|
} else { |
|
|
|
|
|
|
|
return clearInterval(getIntervalMatch) |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
return undefined |
|
|
|
return () => clearInterval(getIntervalMatch) |
|
|
|
}, [matchProfile, sportType, matchId]) |
|
|
|
}, [matchProfile, sportType, matchId]) |
|
|
|
|
|
|
|
|
|
|
|
const { events, matchPlaylists } = useMatchData(matchProfile?.live) |
|
|
|
const { events, matchPlaylists } = useMatchData(matchProfile?.live) |
|
|
|
|