|
|
|
|
@ -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 { |
|
|
|
|
|