@@ -2,7 +2,7 @@ import { Box, CardMedia, FormControl, TextField, Typography, makeStyles } from '
2
2
import { ClearRounded , CloudUploadOutlined } from '@material-ui/icons' ;
3
3
import clsx from 'clsx' ;
4
4
import _ from 'lodash' ;
5
- import React , { useRef } from 'react' ;
5
+ import React , { useRef , useEffect } from 'react' ;
6
6
import styles from '../../../assets/js/styles' ;
7
7
import { isGdriveORVimeoORYoutube } from '../../../views/project_details/projectDetailsScripts' ;
8
8
import { refactorVideoUrl } from '../../input/inputScripts' ;
@@ -14,7 +14,7 @@ function VideoInput({ name, label, required, value = [], handleChange, linkValue
14
14
const classes = makeStyles ( videoInputStyles ) ( ) ;
15
15
const input = useRef ( null ) ;
16
16
const videoRef = useRef ( null ) ;
17
- const clickCount = 0 ;
17
+ var clickCount = 0 ;
18
18
19
19
const handleFileChange = files => {
20
20
const maxAssets = 1 ;
@@ -75,6 +75,11 @@ function VideoInput({ name, label, required, value = [], handleChange, linkValue
75
75
handleChange ( '' , 'link' ) ;
76
76
} ;
77
77
78
+ useEffect ( ( ) => {
79
+ if ( linkValue ) {
80
+ handleChange ( linkValue , 'link' ) ;
81
+ }
82
+ } , [ linkValue , handleChange ] ) ;
78
83
const uploadedVideo = ( ) => {
79
84
if ( typeof value !== 'string' && value ?. length > 0 ) {
80
85
return value ?. map ( ( asset , index ) => (
0 commit comments