oa-componentbook 0.18.218 → 0.18.219
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -101,29 +101,26 @@ function DocumentUpload(_ref) {
|
|
|
101
101
|
fileList: newFileList,
|
|
102
102
|
file
|
|
103
103
|
} = _ref2;
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
let modifiedFile = files;
|
|
110
|
-
setLoading(true);
|
|
111
|
-
try {
|
|
104
|
+
const modifiedList = await Promise.all(newFileList.map(async files => {
|
|
105
|
+
let modifiedFile = files;
|
|
106
|
+
setLoading(true);
|
|
107
|
+
try {
|
|
108
|
+
if ((file === null || file === void 0 ? void 0 : file.uid) === (files === null || files === void 0 ? void 0 : files.uid)) {
|
|
112
109
|
await onChange(files);
|
|
113
110
|
modifiedFile.status = 'done';
|
|
114
111
|
if (!isImageFile(file === null || file === void 0 ? void 0 : file.name)) {
|
|
115
112
|
modifiedFile.url = _PdfSampleImage.default;
|
|
116
113
|
// delete modifiedFile?.type;
|
|
117
114
|
}
|
|
118
|
-
} catch (error) {
|
|
119
|
-
modifiedFile = null;
|
|
120
115
|
}
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
}
|
|
116
|
+
} catch (error) {
|
|
117
|
+
modifiedFile = null;
|
|
118
|
+
}
|
|
119
|
+
setLoading(false);
|
|
120
|
+
return modifiedFile;
|
|
121
|
+
}));
|
|
122
|
+
const tempList = modifiedList === null || modifiedList === void 0 ? void 0 : modifiedList.filter(Boolean);
|
|
123
|
+
setFileList(tempList);
|
|
127
124
|
};
|
|
128
125
|
const uploadButton = /*#__PURE__*/_react.default.createElement("button", {
|
|
129
126
|
style: {
|