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

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 }) => {
if (target.files?.length) {
onUpload(URL.createObjectURL(target.files[0] || " "));
onClose()
}
}}
hidden

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