fix(#2789): fix calculate duration for btn fullgame in matchpage

keep-around/b214ac7012ef42593bee62c207888a2593bc5a38
Andrei Dekterev 3 years ago
parent 848de1229b
commit 7f1855f77f
  1. 9
      src/features/MatchPage/store/hooks/useMatchData.tsx
  2. 1
      src/features/MatchPopup/store/hooks/index.tsx

@ -7,7 +7,9 @@ import { MatchInfo } from 'requests/getMatchInfo'
import { usePageParams } from 'hooks/usePageParams'
import { useInterval } from 'hooks/useInterval'
import { calculateDuration } from '../../helpers/fullMatchDuration'
import { useDuration } from 'features/MultiSourcePlayer/hooks/useDuration'
import { useMatchPopupStore } from 'features/MatchPopup'
import { useMatchPlaylists } from './useMatchPlaylists'
import { useEvents } from './useEvents'
@ -16,6 +18,7 @@ const MATCH_PLAYLISTS_DELAY = 5000
export const useMatchData = (profile: MatchInfo) => {
const { profileId: matchId, sportType } = usePageParams()
const { chapters } = useMatchPopupStore()
const {
fetchMatchPlaylists,
handlePlaylistClick,
@ -29,9 +32,7 @@ export const useMatchData = (profile: MatchInfo) => {
() => debounce(fetchMatchPlaylists, MATCH_PLAYLISTS_DELAY),
[fetchMatchPlaylists],
)
const fullMatchDuration = useMemo(() => calculateDuration(profile), [profile])
const fullMatchDuration = useDuration(chapters) / 1000
useEffect(() => {
if (!profile) return
fetchMatchPlaylists({

@ -115,6 +115,7 @@ export const useMatchPopup = () => {
}
return {
actions,
chapters,
closePopup,
fetchMatchPlaylists,
fetchSportActions,

Loading…
Cancel
Save