diff --git a/src/common/CreateVideoDialog.jsx b/src/common/CreateVideoDialog.jsx index 43196ecc..56a5e92a 100644 --- a/src/common/CreateVideoDialog.jsx +++ b/src/common/CreateVideoDialog.jsx @@ -1,4 +1,4 @@ -import React, { Fragment, useEffect } from "react"; +import React, { Fragment, useEffect, useState } from "react"; import { useDispatch, useSelector } from "react-redux"; import { MenuProps } from "utils"; @@ -78,6 +78,14 @@ const CreateVideoDialog = ({ (state) => state.getSupportedLanguages.transcriptionLanguage ); + const videosInProject = useSelector((state)=>state.getProjectVideoList.data) + const [showPopup, setShowPopup] = useState(false); + useEffect(() => { + if (videosInProject.some((video) => video.url === videoLink)) { + setShowPopup(true); + } + }, [videoLink, videosInProject]); + const handleClear = () => { setLang(""); setVideoLink(""); @@ -241,6 +249,55 @@ const CreateVideoDialog = ({ onChange={(event) => setVideoLink(event.target.value)} sx={{ mt: 3 }} /> + {showPopup && ( +
This video already exists in the project. Do you want to upload it again?
+ + + +