86 lines
4.3 KiB
TypeScript
86 lines
4.3 KiB
TypeScript
/* Metro module 7880; source: modules/media_uploads/handleUploadAttachmentErrors.native.tsx; dependencies: [661, 4697, 7881, 4655, 4647, 1244, 8003, 2] */
|
|
function _fun63181(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#63181, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8058:6, offset: 0x01b737fc, size: 132 bytes, params: 8, frame: 18
|
|
const env0_0 = require;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
const constantsModule = require(661) /* metro dependency 661: Constants */;
|
|
const env0_3 = constantsModule.AbortCodes;
|
|
const env0_4 = constantsModule.MAX_UPLOAD_COUNT;
|
|
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/media_uploads/handleUploadAttachmentErrors.native.tsx');
|
|
exports.handleUploadMessageAttachmentsErrors = handleUploadMessageAttachmentsErrors;
|
|
}
|
|
|
|
function handleUploadMessageAttachmentsErrors({file, guildId, analyticsLocations, code, reason}) { // fn#63182, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8058:276, offset: 0x01b73880, size: 768 bytes, params: 2, frame: 24
|
|
var r1;
|
|
var show;
|
|
var defaultImport;
|
|
var object2;
|
|
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
|
|
const t = (require(1244) /* metro dependency 1244: indexNative */).t;
|
|
var defaultImport2;
|
|
var defaultImport3;
|
|
var kestrelConfig;
|
|
var defaultImport4;
|
|
var moduleValue3;
|
|
var getEffectiveKestrelLimit;
|
|
var moduleValue4;
|
|
let value = undefined;
|
|
if (value === code) {
|
|
return false;
|
|
}
|
|
const ENTITY_TOO_LARGE = AbortCodes.ENTITY_TOO_LARGE;
|
|
if (code === ENTITY_TOO_LARGE) {
|
|
kestrelConfig = (require(4697) /* metro dependency 4697: KestrelExperiment */).getKestrelConfig({location: 'native.handleUploadMessageAttachmentsErrors'});
|
|
defaultImport4 = importDefault(7881) /* metro dependency 7881: showUploadFileSizeError */;
|
|
object2 = {file: file};
|
|
moduleValue3 = require(4697) /* metro dependency 4697: KestrelExperiment */;
|
|
getEffectiveKestrelLimit = moduleValue3.getEffectiveKestrelLimit;
|
|
moduleValue4 = require(4655) /* metro dependency 4655: FileUtils */;
|
|
object2.maxSize = Reflect.apply(getEffectiveKestrelLimit, moduleValue3, [kestrelConfig,
|
|
moduleValue4.maxFileSize(guildId)]);
|
|
object2.analyticsLocations = analyticsLocations;
|
|
object2.errorReason = reason == null ? value : reason.type;
|
|
defaultImport4(object2);
|
|
return true;
|
|
}
|
|
const TOO_MANY_ATTACHMENTS = AbortCodes.TOO_MANY_ATTACHMENTS;
|
|
if (code === TOO_MANY_ATTACHMENTS) {
|
|
defaultImport3 = importDefault(4647) /* metro dependency 4647: AlertActionCreators */;
|
|
defaultImport3.show({title: intl.string(t.wOr6hB), body: intl.formatToPlainString(t['qqyp/e'],
|
|
{limit: MAX_UPLOAD_COUNT})});
|
|
return true;
|
|
}
|
|
const ENTITY_EMPTY = AbortCodes.ENTITY_EMPTY;
|
|
if (code === ENTITY_EMPTY) {
|
|
defaultImport2 = importDefault(4647) /* metro dependency 4647: AlertActionCreators */;
|
|
show = defaultImport2.show;
|
|
object2 = {};
|
|
object2.title = intl.string(t.B3vFdU);
|
|
object2.body = intl.string(t['9ZpT2C']);
|
|
Reflect.apply(show, defaultImport2, [object2]);
|
|
return true;
|
|
}
|
|
const INVALID_FILE_ASSET = AbortCodes.INVALID_FILE_ASSET;
|
|
if (code === INVALID_FILE_ASSET) {
|
|
defaultImport = importDefault(4647) /* metro dependency 4647: AlertActionCreators */;
|
|
show = defaultImport.show;
|
|
object2 = {};
|
|
object2.title = intl.string(t.B3vFdU);
|
|
object2.body = intl.string(t.zMEjJg);
|
|
Reflect.apply(show, defaultImport, [object2]);
|
|
return true;
|
|
}
|
|
const attachmentUploadAbortAlertContent = (require(8003) /* metro dependency 8003: getAttachmentUploadAbortAlert */).getAttachmentUploadAbortAlertContent(code);
|
|
const value4 = attachmentUploadAbortAlertContent != null;
|
|
if (value4) {
|
|
value = importDefault(4647) /* metro dependency 4647: AlertActionCreators */;
|
|
value.show(attachmentUploadAbortAlertContent);
|
|
value = true;
|
|
r1 = value;
|
|
} else {
|
|
r1 = value4;
|
|
}
|
|
return r1;
|
|
}
|
|
|