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

138 lines
6.8 KiB
TypeScript

/* Metro module 11364; source: modules/applications/useGetOrFetchApplicationBatched.tsx; dependencies: [6, 7, 31, 4234, 4041, 22, 6772, 566, 2] */
function _fun87131(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#87131, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11550:6, offset: 0x01fb0c8f, size: 223 bytes, params: 8, frame: 20
let env0_0 = require;
const closure = useRequestApplication;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_3 = importDefault(6) /* metro dependency 6 */;
const env0_4 = importDefault(7) /* metro dependency 7 */;
const env0_5 = importAll(31) /* metro dependency 31 */;
const applicationStore = importDefault(4234) /* metro dependency 4234: ApplicationStore */;
let value = _fun87134();
value = new value();
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/applications/useGetOrFetchApplicationBatched.tsx');
exports.useRequestApplication = closure;
exports.useGetOrFetchApplicationBatched = function(a0) {
var env0_0 = a0;
useRequestApplication(a0);
return require(dependencyMap[7]).useStateFromStores([ApplicationStore], _fun87144, [a0]);
};
}
function useRequestApplication(a0) { // fn#87132, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11550:938, offset: 0x01fb0d6e, size: 46 bytes, params: 2, frame: 14
const env0_0 = a0;
env0_5.useEffect(_fun87133, [a0]);
}
function _fun87134() { // fn#87134, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11550:142, offset: 0x01fb0dd5, size: 84 bytes, params: 1, frame: 15
return env0_4(ApplicationFetchManager, [{key: 'request', value: function(a0) {
var r1;
var value;
var value2;
var property = this._pending;
if (!property.has(a0)) {
property = this._lastFetchedAttempted;
value = property.get(a0);
value2 = value != null;
if (value2) {
value = global.Date.now() - value;
value = value < 60000;
r1 = value;
} else {
r1 = value2;
}
if (!r1) {
property = this._pending;
property.add(a0);
property = this._flushHandler;
property.delay(false);
}
}
}}, {key: '_flush', value: value_87138}]);
}
function useGetOrFetchApplicationBatched(a0) { // fn#87143, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11550:1197, offset: 0x01fb10fb, size: 84 bytes, params: 2, frame: 17
const env0_0 = a0;
useRequestApplication(a0);
return (require(566) /* metro dependency 566: flux */).useStateFromStores([ApplicationStore], _fun87144, [a0]);
}
function _fun87133() { // fn#87133, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11550:985, offset: 0x01fb0d9c, size: 57 bytes, params: 1, frame: 12
var value4;
if (env0_0 != null && env0_0 !== '') {
value4 = environment.__proto__;
env1_7.request(env0_0);
}
}
function ApplicationFetchManager() { // fn#87135, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11550:163, offset: 0x01fb0e29, size: 161 bytes, params: 1, frame: 16
var environment;
const value = environment.__proto__;
env1_3(this, ApplicationFetchManager);
const Map = global.Map;
const value3 = Object.create(Map.prototype, {constructor: {value: Map}});
const map = new Map();
this._lastFetchedAttempted = map instanceof Object ? map : value3;
const Set = global.Set;
const value5 = Object.create(Set.prototype, {constructor: {value: Set}});
const set = new Set();
this._pending = set instanceof Object ? set : value5;
const DelayedCall = (require(4041) /* metro dependency 4041: Timers */).DelayedCall;
this._flushHandler = new DelayedCall(32, _fun87136);
}
function value_87138() { // fn#87138, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11550:559, offset: 0x01fb0f45, size: 227 bytes, params: 1, frame: 16
var environment;
var value;
this._pending.forEach(_fun87139);
this._pending.clear();
const items2 = [];
const items3 = [];
[].forEach(_fun87140);
if (items2.length > 0) {
value = environment.__proto__;
value = importDefault(22) /* metro dependency 22 */;
value = value.chunk(items2, 20);
value.forEach(_fun87141);
}
if (items3.length > 0) {
value = environment.__proto__;
value = importDefault(22) /* metro dependency 22 */;
value = value.chunk(items3, 20);
value.forEach(_fun87142);
}
}
function _fun87144() { // fn#87144, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11550:1305, offset: 0x01fb114f, size: 56 bytes, params: 1, frame: 13
const value2 = null;
return value2 != env0_0 ? env0_0 === '' ? value2 : ApplicationStore.getApplication(env0_0) : value2;
}
function _fun87139(a0) { // fn#87139, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11550:602, offset: 0x01fb1028, size: 62 bytes, params: 2, frame: 15
const _lastFetchedAttempted = env0_0._lastFetchedAttempted;
const set = _lastFetchedAttempted.set;
const Date = global.Date;
Reflect.apply(set, _lastFetchedAttempted, [a0, Date.now()]);
env0_1.push(a0);
}
function _fun87140(a0) { // fn#87140, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11550:711, offset: 0x01fb1066, size: 61 bytes, params: 2, frame: 12
const value = environment.__proto__.__proto__;
if (ApplicationStore.didFetchingApplicationFail(a0)) {
env0_3.push(a0);
} else {
env0_2.push(a0);
}
}
function _fun87141(a0) { // fn#87141, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11550:811, offset: 0x01fb10a3, size: 44 bytes, params: 2, frame: 14
const value = environment.__proto__.__proto__;
(importDefault(6772) /* metro dependency 6772: ApplicationActionCreators */).fetchApplications(a0, false);
}
function _fun87142(a0) { // fn#87142, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11550:891, offset: 0x01fb10cf, size: 44 bytes, params: 2, frame: 14
const value = environment.__proto__.__proto__;
(importDefault(6772) /* metro dependency 6772: ApplicationActionCreators */).fetchApplications(a0, true);
}