|
|
|
|
@ -3,6 +3,7 @@ import { |
|
|
|
|
useEffect, |
|
|
|
|
useCallback, |
|
|
|
|
} from 'react' |
|
|
|
|
import { useLocation } from 'react-router-dom' |
|
|
|
|
|
|
|
|
|
import isEmpty from 'lodash/isEmpty' |
|
|
|
|
|
|
|
|
|
@ -32,6 +33,7 @@ type ArgsFetchMatchPlaylists = { |
|
|
|
|
const initialPlaylists = buildPlaylists(null) |
|
|
|
|
|
|
|
|
|
export const useMatchPopup = () => { |
|
|
|
|
const { pathname } = useLocation() |
|
|
|
|
const [match, setMatch] = useState<MatchData>(null) |
|
|
|
|
|
|
|
|
|
const [matchPlaylists, setMatchPlaylists] = useState<Playlists>(initialPlaylists) |
|
|
|
|
@ -81,6 +83,10 @@ export const useMatchPopup = () => { |
|
|
|
|
setSelectedPlaylistFormat, |
|
|
|
|
]) |
|
|
|
|
|
|
|
|
|
useEffect(() => { |
|
|
|
|
setMatchPlaylists(initialPlaylists) |
|
|
|
|
}, [pathname]) |
|
|
|
|
|
|
|
|
|
const fetchMatchPlaylists = useCallback(({ |
|
|
|
|
id, |
|
|
|
|
sportType, |
|
|
|
|
|