diff --git a/zubhub_frontend/zubhub/src/components/form/videoInput/VideoInput.jsx b/zubhub_frontend/zubhub/src/components/form/videoInput/VideoInput.jsx index 9e4857bd6..355f48245 100644 --- a/zubhub_frontend/zubhub/src/components/form/videoInput/VideoInput.jsx +++ b/zubhub_frontend/zubhub/src/components/form/videoInput/VideoInput.jsx @@ -2,7 +2,7 @@ import { Box, CardMedia, FormControl, TextField, Typography, makeStyles } from ' import { ClearRounded, CloudUploadOutlined } from '@material-ui/icons'; import clsx from 'clsx'; import _ from 'lodash'; -import React, { useRef } from 'react'; +import React, { useRef, useEffect } from 'react'; import styles from '../../../assets/js/styles'; import { isGdriveORVimeoORYoutube } from '../../../views/project_details/projectDetailsScripts'; import { refactorVideoUrl } from '../../input/inputScripts'; @@ -14,7 +14,7 @@ function VideoInput({ name, label, required, value = [], handleChange, linkValue const classes = makeStyles(videoInputStyles)(); const input = useRef(null); const videoRef = useRef(null); - const clickCount = 0; + var clickCount = 0; const handleFileChange = files => { const maxAssets = 1; @@ -75,6 +75,11 @@ function VideoInput({ name, label, required, value = [], handleChange, linkValue handleChange('', 'link'); }; + useEffect(() => { + if (linkValue) { + handleChange(linkValue, 'link'); + } + }, [linkValue, handleChange]); const uploadedVideo = () => { if (typeof value !== 'string' && value?.length > 0) { return value?.map((asset, index) => (