|
|
|
@ -35,7 +35,7 @@ export const MatchDownloadButton = ({ |
|
|
|
const { profile } = useMatchPageStore() |
|
|
|
const { profile } = useMatchPageStore() |
|
|
|
const { sportType } = usePageParams() |
|
|
|
const { sportType } = usePageParams() |
|
|
|
const [playlistConfig, setPlaylistConfig] = useState<DownloadPlaylistProps | null>(null) |
|
|
|
const [playlistConfig, setPlaylistConfig] = useState<DownloadPlaylistProps | null>(null) |
|
|
|
|
|
|
|
const [isDownloaded, setIsDownloaded] = useState(false) |
|
|
|
const { |
|
|
|
const { |
|
|
|
close, |
|
|
|
close, |
|
|
|
isOpen, |
|
|
|
isOpen, |
|
|
|
@ -82,8 +82,13 @@ export const MatchDownloadButton = ({ |
|
|
|
|
|
|
|
|
|
|
|
useEffect(() => { |
|
|
|
useEffect(() => { |
|
|
|
if (!data) return undefined |
|
|
|
if (!data) return undefined |
|
|
|
if (data?.status === 'COMPLETED' && data.urls) { |
|
|
|
|
|
|
|
|
|
|
|
if ( |
|
|
|
|
|
|
|
data?.status === 'COMPLETED' |
|
|
|
|
|
|
|
&& data.urls |
|
|
|
|
|
|
|
&& !isDownloaded) { |
|
|
|
downloadFile(data.urls) |
|
|
|
downloadFile(data.urls) |
|
|
|
|
|
|
|
setIsDownloaded(true) |
|
|
|
closeDownloadNotification() |
|
|
|
closeDownloadNotification() |
|
|
|
stop() |
|
|
|
stop() |
|
|
|
} else if (data?.status === 'ERROR') { |
|
|
|
} else if (data?.status === 'ERROR') { |
|
|
|
|