@ones-editor/editor 0.0.7-beta.49 → 0.0.7-beta.50
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.
package/dist/index.js
CHANGED
|
@@ -70904,7 +70904,7 @@ ${data.flowchartText}
|
|
|
70904
70904
|
return errorContainer;
|
|
70905
70905
|
}
|
|
70906
70906
|
renderRetry(file2, error2) {
|
|
70907
|
-
var _a, _b, _c;
|
|
70907
|
+
var _a, _b, _c, _d, _e;
|
|
70908
70908
|
assert(logger$5, this.abstract, "no abstract");
|
|
70909
70909
|
const { editor } = this.options;
|
|
70910
70910
|
const { mediaIcon, mediaName } = this.abstract;
|
|
@@ -70913,13 +70913,15 @@ ${data.flowchartText}
|
|
|
70913
70913
|
icon.innerHTML = mediaIcon;
|
|
70914
70914
|
const errorDetail = createElement("div", [], retry);
|
|
70915
70915
|
let html = i18n$1.t("media.upload.failed", { name: mediaName });
|
|
70916
|
-
if (((_a = error2.response) == null ? void 0 : _a.status) === 420) {
|
|
70917
|
-
const message = (
|
|
70916
|
+
if (((_a = error2.response) == null ? void 0 : _a.status) === 420 || ((_b = error2.response) == null ? void 0 : _b.status) === 413) {
|
|
70917
|
+
const message = (_e = (_d = (_c = error2.response) == null ? void 0 : _c.data) == null ? void 0 : _d.message[0]) != null ? _e : "";
|
|
70918
70918
|
const fileSizeMatch = message.match(/(\d+)/);
|
|
70919
70919
|
if (fileSizeMatch) {
|
|
70920
70920
|
const fileSize = Number.parseInt(fileSizeMatch[1], 10);
|
|
70921
70921
|
const formattedSize = formatFileSize(fileSize, 0);
|
|
70922
70922
|
html = i18n$1.t("media.upload.maxSizeFailed", { name: mediaName, size: formattedSize });
|
|
70923
|
+
} else {
|
|
70924
|
+
html = i18n$1.t("media.upload.maxSizeFailed", { name: mediaName, size: "maxRequestBodySize" });
|
|
70923
70925
|
}
|
|
70924
70926
|
}
|
|
70925
70927
|
errorDetail.innerHTML = html;
|