decord/source/modules/media_uploads/handleUploadAttachmentErrors.native.tsx
github-actions 67d978d9fb chore: update source for alpha 346.0
Skipped 1 file(s) >100MB (GitHub limit): source/__vendor/09xxx/9672_m.js (378.6 MB)
2026-09-07 16:44:02 +00:00

81 lines
3.3 KiB
TypeScript

// Module ID: 9314
// Function ID: 9315
// Name: handleUploadMessageAttachmentsErrors
// Dependencies: [1074, 5179, 5134, 9315, 4904, 1114, 9398, 2]
// Exports: handleUploadMessageAttachmentsErrors
// Module 9314 (handleUploadMessageAttachmentsErrors)
import set from "set" /* 2 */;
import getSystemLocale from "getSystemLocale" /* 1114 */;
import setDefault from "set" /* 4904 */;
import getUploadFileSizeSum from "getUploadFileSizeSum" /* 5134 */;
import KESTREL_GA_UPLOAD_LIMIT_MB from "KESTREL_GA_UPLOAD_LIMIT_MB" /* 5179 */;
import showUploadFileSizeErrorDefault from "showUploadFileSizeError" /* 9315 */;
import getAttachmentUploadAbortAlertContent from "getAttachmentUploadAbortAlertContent" /* 9398 */;
import ME from "ME" /* 1074 */;
({ AbortCodes: c3, MAX_UPLOAD_COUNT: c4 } = ME);
const result = set.fileFinishedImporting("modules/media_uploads/handleUploadAttachmentErrors.native.tsx");
export const handleUploadMessageAttachmentsErrors = function handleUploadMessageAttachmentsErrors(arg0) {
({ guildId, code, reason } = arg0);
if (undefined === code) {
return false;
} else if (code === constants.ENTITY_TOO_LARGE) {
const kestrelConfig = KESTREL_GA_UPLOAD_LIMIT_MB.getKestrelConfig({ location: "native.handleUploadMessageAttachmentsErrors" });
const obj10 = KESTREL_GA_UPLOAD_LIMIT_MB;
const maxFileSizeResult = getUploadFileSizeSum.maxFileSize(guildId);
let obj = { file: null, maxSize: null, baseMaxSize: null, guildId: null, analyticsLocations: null, errorReason: null };
obj[0] = tmp;
const obj11 = getUploadFileSizeSum;
const tmp27 = showUploadFileSizeErrorDefault;
obj[1] = KESTREL_GA_UPLOAD_LIMIT_MB.getEffectiveKestrelLimit(kestrelConfig, maxFileSizeResult);
obj[2] = maxFileSizeResult;
obj[3] = guildId;
obj[4] = tmp2;
let type;
if (reason != null) {
type = reason.type;
}
obj[5] = type;
tmp27(obj);
return true;
} else if (code === tmp31.TOO_MANY_ATTACHMENTS) {
obj = { title: null, body: null };
const intl5 = getSystemLocale.intl;
obj[0] = intl5.string(getSystemLocale.t.wOr6hB);
const intl6 = getSystemLocale.intl;
obj1 = { limit: null };
obj1[0] = closure_4;
obj[1] = intl6.formatToPlainString(getSystemLocale.t["qqyp/e"], obj1);
setDefault.show(obj);
return true;
} else if (code === tmp31.ENTITY_EMPTY) {
let obj2 = { title: null, body: null };
const intl3 = getSystemLocale.intl;
obj2[0] = intl3.string(getSystemLocale.t.B3vFdU);
const intl4 = getSystemLocale.intl;
obj2[1] = intl4.string(getSystemLocale.t["9ZpT2C"]);
setDefault.show(obj2);
return true;
} else if (code === tmp31.INVALID_FILE_ASSET) {
obj2 = setDefault;
const obj3 = { title: null, body: null };
const intl = getSystemLocale.intl;
obj3[0] = intl.string(getSystemLocale.t.B3vFdU);
const intl2 = getSystemLocale.intl;
obj3[1] = intl2.string(getSystemLocale.t.zMEjJg);
obj2.show(obj3);
return true;
} else {
obj = getAttachmentUploadAbortAlertContent;
const attachmentUploadAbortAlertContent = obj.getAttachmentUploadAbortAlertContent(code);
let flag = null != attachmentUploadAbortAlertContent;
if (flag) {
obj1 = setDefault;
obj1.show(attachmentUploadAbortAlertContent);
flag = true;
}
return flag;
}
};