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

157 lines
6.8 KiB
TypeScript

/* Metro module 5199; source: modules/games/GameStore.tsx; dependencies: [6, 7, 15, 17, 18, 5200, 1471, 566, 694, 2] */
function _fun45895(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#45895, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5377:6, offset: 0x0119a988, size: 439 bytes, params: 8, frame: 19
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_2 = importDefault(6) /* metro dependency 6 */;
const env0_3 = importDefault(7) /* metro dependency 7 */;
const env0_4 = importDefault(15) /* metro dependency 15 */;
const env0_5 = importDefault(17) /* metro dependency 17 */;
const env0_6 = importDefault(18) /* metro dependency 18 */;
const gameRecord = importDefault(5200) /* metro dependency 5200: GameRecord */;
const Map = global.Map;
const map = new Map();
let Set = global.Set;
let set = new Set();
Set = global.Set;
set = new Set();
Set = global.Set;
set = new Set();
const Store = (importDefault(566) /* metro dependency 566: flux */).Store;
_fun45899(Store).displayName = 'NewGameStore';
set = new set(importDefault(694) /* metro dependency 694: Dispatcher */, {LOGOUT: LOGOUT_45906,
GAME_FETCH: function({gameIds}) {
gameIds.forEach(_fun45908);
}, GAME_FETCH_SUCCESS: function({gameIds, games}) {
var Set = global.Set;
var value2 = new Set(gameIds);
var env0_0 = value2;
gameIds.forEach(_fun45910);
games.forEach(_fun45911);
value2.forEach(_fun45912);
}, GAME_FETCH_FAILURE: function({gameIds}) {
gameIds.forEach(_fun45914);
}});
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/games/GameStore.tsx');
exports.default = set;
}
function _isNativeReflectConstruct_45896() { // fn#45896, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5377:158, offset: 0x0119ab3f, size: 94 bytes, params: 1, frame: 18
var Boolean;
var prototype;
var valueOf;
var call;
var Reflect;
var construct;
var closure;
var value;
var error;
try {
Boolean = global.Boolean;
prototype = Boolean.prototype;
valueOf = prototype.valueOf;
call = valueOf.call;
Reflect = global.Reflect;
construct = Reflect.construct;
Boolean = global.Boolean;
closure = function() {
};
value = Reflect.apply(construct, Reflect, [Boolean, [], closure]);
value = Reflect.apply(call, valueOf, [value]);
var result = !value;
} catch (error) {
}
return (_isNativeReflectConstruct_45896_isNativeReflectConstruct = function() {
return !!result;
})();
}
function _fun45899(a0) { // fn#45899, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5377:401, offset: 0x0119ab9d, size: 164 bytes, params: 2, frame: 16
const closure = GameStore;
env0_6(closure, a0);
return env0_3(closure, [{key: 'isFetching', value: value_45901}, {key: 'didFetchingFail', value: value_45902},
{key: 'getGame', value: value_45903}, {key: 'hasNoData', value: value_45904}, {key: 'getCoverImageUrl',
value: value_45905}]);
}
function LOGOUT_45906() { // fn#45906, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5377:1187, offset: 0x0119ace5, size: 129 bytes, params: 1, frame: 11
const Map = global.Map;
const map = new Map();
let Set = global.Set;
let set = new Set();
Set = global.Set;
set = new Set();
Set = global.Set;
set = new Set();
}
function GAME_FETCH({gameIds}) { // fn#45907, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5377:1263, offset: 0x0119ad66, size: 30 bytes, params: 2, frame: 11
gameIds.forEach(_fun45908);
}
function GAME_FETCH_SUCCESS({gameIds, games}) { // fn#45909, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5377:1356, offset: 0x0119adaa, size: 101 bytes, params: 2, frame: 14
const Set = global.Set;
const set = new Set(gameIds);
gameIds.forEach(_fun45910);
games.forEach(_fun45911);
set.forEach(_fun45912);
}
function GAME_FETCH_FAILURE({gameIds}) { // fn#45913, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5377:1575, offset: 0x0119aead, size: 30 bytes, params: 2, frame: 11
gameIds.forEach(_fun45914);
}
function value_45905(a0, a1) { // fn#45905, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5377:899, offset: 0x0119ac57, size: 142 bytes, params: 3, frame: 17
var r2;
var searchParams;
let value = environment.__proto__;
const coverURL = env1_8.get(a0)?.getCoverURL();
if (coverURL == null) {
return null;
}
if (a1 == null) {
return coverURL;
}
value = importDefault(1471) /* metro dependency 1471: URLUtils */;
value = value.toURLSafe(coverURL);
if (value == null) {
r2 = coverURL;
} else {
searchParams = value.searchParams;
searchParams.set('size', a1.size.toString());
value = value.toString();
r2 = value;
}
return r2;
}
function _fun45908(a0) { // fn#45908, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5377:1308, offset: 0x0119ad84, size: 38 bytes, params: 2, frame: 12
env1_9.add(a0);
env1_10.delete(a0);
}
function _fun45910(a0) { // fn#45910, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5377:1433, offset: 0x0119ae0f, size: 38 bytes, params: 2, frame: 12
env1_9.delete(a0);
env1_10.delete(a0);
}
function _fun45911(a0) { // fn#45911, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5377:1475, offset: 0x0119ae35, size: 79 bytes, params: 2, frame: 15
let binding = env0_0;
binding.delete(a0.id);
const value = environment.__proto__;
binding = env1_8;
binding.set(a0.id, new GameRecord(a0));
}
function _fun45912(a0) { // fn#45912, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5377:1529, offset: 0x0119ae84, size: 41 bytes, params: 2, frame: 12
const binding = env1_8;
if (!binding.has(a0)) {
env1_11.add(a0);
}
}
function _fun45914(a0) { // fn#45914, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5377:1627, offset: 0x0119aecb, size: 38 bytes, params: 2, frame: 12
env1_9.delete(a0);
env1_10.add(a0);
}