fix(#480): full match request when list is empty aswell (#174)

keep-around/af30b88d367751c9e05a735e4a0467a96238ef47
Mirlan 5 years ago committed by GitHub
parent 4457b977ea
commit a89571e5ad
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 6
      src/features/MatchPage/hooks/useVideoData.tsx

@ -1,10 +1,12 @@
import { useEffect, useState } from 'react'
import isNull from 'lodash/isNull'
import isEmpty from 'lodash/isEmpty'
import type { LiveVideos, Videos } from 'requests'
import { getLiveVideos, getVideos } from 'requests'
import { useSportNameParam, usePageId } from 'hooks'
import { isNull } from 'lodash'
import { useLastPlayPosition } from './useLastPlayPosition'
@ -17,7 +19,7 @@ export const useVideoData = () => {
useEffect(() => {
const requestVideos = async () => {
const live = await getLiveVideos(sportType, matchId)
if (isNull(live)) {
if (isNull(live) || isEmpty(live)) {
const videosResponse = await getVideos(sportType, matchId)
setVideos(videosResponse)
} else {

Loading…
Cancel
Save