Files
discord-decomp/sources/modules/game_claim/UnclaimedGamesActionCreators.tsx
T
2026-07-28 01:06:53 +03:00

87 lines
5.0 KiB
TypeScript

/* Metro module 14575; source: modules/game_claim/UnclaimedGamesActionCreators.tsx; dependencies: [5, 14576, 661, 507, 694, 566, 672, 561, 2] */
import Module00005 from '../../by-id/module-00005.js'; /* Metro dependency 5 */
import Backoff from '../../external/discord_common/js/packages/backoff/Backoff.tsx'; /* Metro dependency 561 */
import Durations from '../../utils/Durations.tsx'; /* Metro dependency 672 */
import UnclaimedGamesStore from './UnclaimedGamesStore.tsx'; /* Metro dependency 14576 */
import * as FileImportTrackerModule from '../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
import * as FluxModule from '../../external/discord_common/js/packages/flux/index.tsx'; /* Metro dependency 566 */
import * as ConstantsModule from '../../Constants.tsx'; /* Metro dependency 661 */
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
const env0_0 = require;
const closure = function() {
return _fetchUnclaimedGames.apply(this, arguments);
};
const useUnclaimedGameIdsForGuild2 = useUnclaimedGameIdsForGuild;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
let value = UnclaimedGamesStore;
const env0_6 = [];
const createFetchStore = FluxModule.createFetchStore;
const Seconds = (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}}]);
object = {fetch: closure};
(FileImportTrackerModule).fileFinishedImporting('modules/game_claim/UnclaimedGamesActionCreators.tsx');
exports.default = object;
exports.fetchUnclaimedGames = closure;
exports.useUnclaimedGames = value;
exports.useUnclaimedGameIdsForGuild = useUnclaimedGameIdsForGuild2;
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 Module00005(_fun110265).apply(this, arguments);
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});
}
}
}
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 = Backoff;
const Millis = (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;
}
}
global.__d(_fun110261, 14575, [5, 14576, 661, 507, 694, 566, 672, 561,
2]) /* metro module 14575, dependencies: [5, 14576, 661, 507, 694, 566, 672, 561, 2] */;