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