mirror of
https://github.com/PlayEdu/backend
synced 2025-06-08 07:24:24 +08:00
上传视频关闭窗口取消所有任务
This commit is contained in:
parent
b4dd5a6b46
commit
defc71697a
@ -124,14 +124,29 @@ export const UploadVideoButton = (props: PropsInterface) => {
|
||||
};
|
||||
|
||||
const closeWin = () => {
|
||||
if (upRef.current > 0) {
|
||||
message.error(`等待上传成功后才能关闭`);
|
||||
return;
|
||||
// if (upRef.current > 0) {
|
||||
// message.error(`等待上传成功后才能关闭`);
|
||||
// return;
|
||||
// }
|
||||
|
||||
if (fileList.length > 0) {
|
||||
let i = 0;
|
||||
fileList.map((item: any) => {
|
||||
item.run.cancel();
|
||||
i++;
|
||||
});
|
||||
if (i === fileList.length) {
|
||||
setShowModal(false);
|
||||
setFileList([]);
|
||||
localFileList.current = [];
|
||||
props.onUpdate();
|
||||
}
|
||||
} else {
|
||||
setShowModal(false);
|
||||
setFileList([]);
|
||||
localFileList.current = [];
|
||||
props.onUpdate();
|
||||
}
|
||||
setShowModal(false);
|
||||
setFileList([]);
|
||||
localFileList.current = [];
|
||||
props.onUpdate();
|
||||
};
|
||||
|
||||
return (
|
||||
|
Loading…
x
Reference in New Issue
Block a user