Files
discord-decomp/sources/modules/media_uploads/handleUploadAttachmentErrors.native.tsx
2026-07-28 01:06:53 +03:00

90 lines
4.8 KiB
TypeScript

/* Metro module 7880; source: modules/media_uploads/handleUploadAttachmentErrors.native.tsx; dependencies: [661, 4697, 7881, 4655, 4647, 1244, 8003, 2] */
import * as FileImportTrackerModule from '../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
import * as ConstantsModule from '../../Constants.tsx'; /* Metro dependency 661 */
import * as IndexNativeModule from '../../intl/index.native.tsx'; /* Metro dependency 1244 */
import * as GetAttachmentUploadAbortAlertModule from './getAttachmentUploadAbortAlert.tsx'; /* Metro dependency 8003 */
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});
(FileImportTrackerModule).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 object;
const intl = (IndexNativeModule).intl;
const t = (IndexNativeModule).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 */;
object = {file: file};
moduleValue3 = require(4697) /* metro dependency 4697: KestrelExperiment */;
getEffectiveKestrelLimit = moduleValue3.getEffectiveKestrelLimit;
moduleValue4 = require(4655) /* metro dependency 4655: FileUtils */;
object.maxSize = Reflect.apply(getEffectiveKestrelLimit, moduleValue3, [kestrelConfig,
moduleValue4.maxFileSize(guildId)]);
object.analyticsLocations = analyticsLocations;
object.errorReason = reason == null ? value : reason.type;
defaultImport4(object);
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;
object = {};
object.title = intl.string(t.B3vFdU);
object.body = intl.string(t['9ZpT2C']);
Reflect.apply(show, defaultImport2, [object]);
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;
object = {};
object.title = intl.string(t.B3vFdU);
object.body = intl.string(t.zMEjJg);
Reflect.apply(show, defaultImport, [object]);
return true;
}
const attachmentUploadAbortAlertContent = (GetAttachmentUploadAbortAlertModule).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;
}
}
global.__d(_fun63181, 7880, [661, 4697, 7881, 4655, 4647, 1244, 8003,
2]) /* metro module 7880, dependencies: [661, 4697, 7881, 4655, 4647, 1244, 8003, 2] */;