@@ -2,7 +2,7 @@ import { Box, CardMedia, FormControl, TextField, Typography, makeStyles } from '
22import { ClearRounded , CloudUploadOutlined } from '@material-ui/icons' ;
33import clsx from 'clsx' ;
44import _ from 'lodash' ;
5- import React , { useRef } from 'react' ;
5+ import React , { useRef , useEffect } from 'react' ;
66import styles from '../../../assets/js/styles' ;
77import { isGdriveORVimeoORYoutube } from '../../../views/project_details/projectDetailsScripts' ;
88import { refactorVideoUrl } from '../../input/inputScripts' ;
@@ -14,7 +14,7 @@ function VideoInput({ name, label, required, value = [], handleChange, linkValue
1414 const classes = makeStyles ( videoInputStyles ) ( ) ;
1515 const input = useRef ( null ) ;
1616 const videoRef = useRef ( null ) ;
17- const clickCount = 0 ;
17+ var clickCount = 0 ;
1818
1919 const handleFileChange = files => {
2020 const maxAssets = 1 ;
@@ -75,6 +75,11 @@ function VideoInput({ name, label, required, value = [], handleChange, linkValue
7575 handleChange ( '' , 'link' ) ;
7676 } ;
7777
78+ useEffect ( ( ) => {
79+ if ( linkValue ) {
80+ handleChange ( linkValue , 'link' ) ;
81+ }
82+ } , [ linkValue , handleChange ] ) ;
7883 const uploadedVideo = ( ) => {
7984 if ( typeof value !== 'string' && value ?. length > 0 ) {
8085 return value ?. map ( ( asset , index ) => (
0 commit comments