@@ -3,7 +3,7 @@ import { makeStyles } from '@mui/styles';
33import { ClearRounded , CloudUploadOutlined } from '@mui/icons-material' ;
44import clsx from 'clsx' ;
55import _ from 'lodash' ;
6- import React , { useRef } from 'react' ;
6+ import React , { useRef , useEffect } from 'react' ;
77import styles from '../../../assets/js/styles' ;
88import { isGdriveORVimeoORYoutube } from '../../../views/project_details/projectDetailsScripts' ;
99import { refactorVideoUrl } from '../../input/inputScripts' ;
@@ -15,7 +15,7 @@ function VideoInput({ name, label, required, value = [], handleChange, linkValue
1515 const classes = makeStyles ( videoInputStyles ) ( ) ;
1616 const input = useRef ( null ) ;
1717 const videoRef = useRef ( null ) ;
18- const clickCount = 0 ;
18+ var clickCount = 0 ;
1919
2020 const handleFileChange = files => {
2121 const maxAssets = 1 ;
@@ -76,6 +76,12 @@ function VideoInput({ name, label, required, value = [], handleChange, linkValue
7676 handleChange ( '' , 'link' ) ;
7777 } ;
7878
79+ useEffect ( ( ) => {
80+ if ( linkValue ) {
81+ handleChange ( linkValue , 'link' ) ;
82+ }
83+ } , [ linkValue , handleChange ] ) ;
84+
7985 const uploadedVideo = ( ) => {
8086 if ( typeof value !== 'string' && value ?. length > 0 ) {
8187 return value ?. map ( ( asset , index ) => (
0 commit comments