Files
discord-decomp/sources/modules/polls/PollAttachmentUtils.tsx
T
2026-07-27 16:20:00 +03:00

76 lines
3.5 KiB
TypeScript

/* Metro module 11740; source: modules/polls/PollAttachmentUtils.tsx; dependencies: [5, 7217, 2] */
function _fun89994(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#89994, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11926:6, offset: 0x020264fa, size: 165 bytes, params: 8, frame: 18
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_0 = importDefault(5) /* metro dependency 5 */;
const env0_1 = (require(7217) /* metro dependency 7217: PollsConstants */).POLL_ATTACHMENT_FOLDER;
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/polls/PollAttachmentUtils.tsx');
exports.getFileNameFromGifUrl = function(a0, a1) {
var value = (0, global.decodeURIComponent)(a1);
value = value.split('/');
value = value.pop();
return '' + a0 + '-' + (value ?? 'temp.gif');
};
exports.getFilePathForGif = function(a0) {
return POLL_ATTACHMENT_FOLDER + '/' + a0;
};
exports.downloadPollGif = function() {
return _downloadPollGif.apply(this, arguments);
};
}
function _downloadPollGif() { // fn#89995, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11926:139, offset: 0x0202659f, size: 50 bytes, params: 1, frame: 14
return env0_0(_fun89997).apply(this, arguments);
}
function* _fun89997(a0) { // fn#89997, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11926:194, offset: 0x020265dc, size: 81 bytes, params: 2, frame: 13
if (false) {
return undefined;
}
yield global.fetch(a0);
value = undefined;
if (false) {
return value;
}
yield value.blob();
value = undefined;
if (false) {
return value;
}
return ((a0) => {
var env0_0 = a0;
var property = global.FileReader;
var env0_1 = new property();
property = global.Promise;
value2 = Object.create(property.prototype, {constructor: {value: property}});
var value3 = new property(_fun89999);
return value3 instanceof Object ? value3 : value2;
})(value);
}
function convertBlobToBase64(a0) { // fn#89998, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11926:235, offset: 0x0202662d, size: 76 bytes, params: 2, frame: 12
const env0_0 = a0;
const FileReader = global.FileReader;
let fileReader = new FileReader();
const Promise = global.Promise;
fileReader = Object.create(Promise.prototype, {constructor: {value: Promise}});
const promise = new Promise(_fun89999);
return promise instanceof Object ? promise : fileReader;
}
function _fun89999(a0, a1) { // fn#89999, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11926:308, offset: 0x02026679, size: 57 bytes, params: 3, frame: 11
const env0_0 = a0;
const binding = env0_1;
binding.onload = onload_90000;
binding.onerror = a1;
binding.readAsDataURL(env0_0);
}
function onload_90000() { // fn#90000, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11926:325, offset: 0x020266b2, size: 53 bytes, params: 1, frame: 11
let value = environment.__proto__;
value = env1_1.result.split(',');
value = value.pop();
env0_0(value);
}