автозакрытие модалки при загрузке видео

This commit is contained in:
Nastya 2025-03-31 21:13:19 +03:00
parent 62a9237925
commit de8f66a837
2 changed files with 7 additions and 2 deletions

@ -94,6 +94,7 @@ export default function UploadVideoModal({ open, onClose, video, onUpload }: Hel
onChange={({ target }) => { onChange={({ target }) => {
if (target.files?.length) { if (target.files?.length) {
onUpload(URL.createObjectURL(target.files[0] || " ")); onUpload(URL.createObjectURL(target.files[0] || " "));
onClose()
} }
}} }}
hidden hidden

@ -85,7 +85,7 @@ export const MediaSelectionAndDisplay: FC<Iprops> = ({
}); });
} }
setBackgroundUploading(false); setTimeout(() => {setBackgroundUploading(false)},7000);
} }
return ( return (
@ -155,7 +155,11 @@ export const MediaSelectionAndDisplay: FC<Iprops> = ({
<UploadVideoModal <UploadVideoModal
open={isVideoUploadDialogOpen} open={isVideoUploadDialogOpen}
onClose={() => setIsVideoUploadDialogOpen(false)} onClose={() => setIsVideoUploadDialogOpen(false)}
onUpload={handleVideoUpload} onUpload={(s:string) => {
handleVideoUpload(s);
setTimeout(() => {setBackgroundUploading(false)},5000);
}
}
video={question.content.video} video={question.content.video}
/> />