Automatic dismiss of upload popup

This commit is contained in:
2023-03-01 12:27:28 +01:00
parent 7b0bdb5aca
commit e41ea74d6d

View File

@@ -75,13 +75,15 @@ const SignDetailpage: React.FC<Props> = (props) => {
const handleUpload = async () => {
setUploadProgress(0);
uploadSignVideo(sign!.id, recordedBlob!, handleUploadProgress).then((response) => {
setUploadProgress(100);
setPopUpShown(false);
// add the new sign video to the sign
console.log(response)
const newSign = { ...sign! };
newSign.sign_videos.push(response);
setSign(newSign);
setUploadProgress(100);
}).catch((error) => {
setUploadProgress(null);
}