pass 'cost' into effect instead of costInfo
This commit is contained in:
parent
dd5c1ca7e8
commit
2470abae5c
1 changed files with 3 additions and 3 deletions
|
@ -41,7 +41,7 @@ export default function FileViewer(props: Props) {
|
|||
hasCostInfo,
|
||||
costInfo,
|
||||
} = props;
|
||||
|
||||
const cost = costInfo && costInfo.cost;
|
||||
const isPlayable = ['audio', 'video'].indexOf(mediaType) !== -1;
|
||||
const fileStatus = fileInfo && fileInfo.status;
|
||||
|
||||
|
@ -79,10 +79,10 @@ export default function FileViewer(props: Props) {
|
|||
|
||||
useEffect(() => {
|
||||
const videoOnPage = document.querySelector('video');
|
||||
if (autoplay && !videoOnPage && isStreamable && hasCostInfo && costInfo.cost === 0) {
|
||||
if (autoplay && !videoOnPage && isStreamable && hasCostInfo && cost === 0) {
|
||||
viewFile();
|
||||
}
|
||||
}, [autoplay, viewFile, isStreamable, hasCostInfo, costInfo]);
|
||||
}, [autoplay, viewFile, isStreamable, hasCostInfo, cost]);
|
||||
|
||||
return (
|
||||
<div
|
||||
|
|
Loading…
Reference in a new issue