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

81 lines
4.3 KiB
TypeScript

/* Metro module 14575; source: modules/game_claim/UnclaimedGamesActionCreators.tsx; dependencies: [5, 14576, 661, 507, 694, 566, 672, 561, 2] */
function _fun110261(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#110261, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14772:6, offset: 0x023726f9, size: 353 bytes, params: 8, frame: 23
var object2;
const env0_0 = require;
const closure = function() {
return _fetchUnclaimedGames.apply(this, arguments);
};
const closure2 = useUnclaimedGameIdsForGuild;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_3 = importDefault(5) /* metro dependency 5 */;
let value = importDefault(14576) /* metro dependency 14576: UnclaimedGamesStore */;
const env0_5 = (require(661) /* metro dependency 661: Constants */).Endpoints;
const env0_6 = [];
const fluxModule = require(566) /* metro dependency 566: flux */;
const createFetchStore = fluxModule.createFetchStore;
const Seconds = (importDefault(672) /* metro dependency 672: Durations */).Seconds;
const DAY = Seconds.DAY;
value = Reflect.apply(createFetchStore, fluxModule, [value, {getQueryId: function(a0) {
return a0 ? 'unclaimed-games' : null;
}, get: function() {
return UnclaimedGamesStore.getMap();
}, load: function() {
return fetch_110262();
}, staleAfter: DAY, retryConfig: {backoff: backoff, maxRetries: 10}}]);
object2 = {fetch: closure};
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/game_claim/UnclaimedGamesActionCreators.tsx');
exports.default = object2;
exports.fetchUnclaimedGames = closure;
exports.useUnclaimedGames = value;
exports.useUnclaimedGameIdsForGuild = closure2;
exports.useHasUnclaimedGames = useHasUnclaimedGames;
}
function _fetchUnclaimedGames() { // fn#110263, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14772:222, offset: 0x0237285a, size: 50 bytes, params: 1, frame: 14
return env0_3(_fun110265).apply(this, arguments);
}
function useUnclaimedGameIdsForGuild(a0) { // fn#110266, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14772:730, offset: 0x0237292a, size: 56 bytes, params: 2, frame: 13
const value = a1;
const value2 = undefined;
const data = env0_7(!(value !== value2) || value).data;
let r0 = data == null ? value2 : data[a0];
r0 = r0 ?? env0_6;
return r0;
}
function backoff() { // fn#110270, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14772:671, offset: 0x02372987, size: 78 bytes, params: 1, frame: 13
let value = importDefault(561) /* metro dependency 561: Backoff */;
const Millis = (importDefault(672) /* metro dependency 672: Durations */).Millis;
const MINUTE = Millis.MINUTE;
const value2 = 5 * MINUTE;
const value3 = Object.create(value.prototype, {constructor: {value: value}});
value = new value(value2);
return value instanceof Object ? value : value3;
}
function useHasUnclaimedGames(a0) { // fn#110271, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14772:1110, offset: 0x023729d5, size: 40 bytes, params: 2, frame: 13
const value = a1;
return useUnclaimedGameIdsForGuild(a0, !(value !== undefined) || value).length > 0;
}
function* _fun110265() { // fn#110265, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14772:285, offset: 0x02372897, size: 147 bytes, params: 1, frame: 16
if (true) {
value = environment.__proto__.__proto__;
var HTTP = env2_0(env2_2[3]).HTTP;
var get = HTTP.get;
var UNCLAIMED_GAMES = env2_5.UNCLAIMED_GAMES;
yield Reflect.apply(get, HTTP, [{'url': null, 'oldFormErrors': true, 'rejectWithError': false,
url: UNCLAIMED_GAMES}]);
var value3 = undefined;
if (false) {
return value3;
}
var body = value3.body;
value = env2_1(env2_2[4]);
value.dispatch({type: 'UNCLAIMED_GAMES_FETCH_SUCCESS', guildIdToGameIds: body});
}
}