118 lines
5.4 KiB
TypeScript
118 lines
5.4 KiB
TypeScript
/* Metro module 12567; source: modules/relationships/GuildFriendshipStore.tsx; dependencies: [6, 7, 15, 17, 18, 6593, 566, 694, 2] */
|
|
function _fun96257(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#96257, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12757:6, offset: 0x021590be, size: 357 bytes, params: 8, frame: 21
|
|
var object2;
|
|
const closure = function() {
|
|
env0_8 = {};
|
|
};
|
|
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 */;
|
|
object2 = {NOT_FETCHED: 0};
|
|
object2[0] = 'NOT_FETCHED';
|
|
object2.FETCHING = 1;
|
|
object2[1] = 'FETCHING';
|
|
object2.FETCHED = 2;
|
|
object2[2] = 'FETCHED';
|
|
let env0_8 = {};
|
|
const Store = (importDefault(566) /* metro dependency 566: flux */).Store;
|
|
let value = _fun96263(Store);
|
|
value = new value(importDefault(694) /* metro dependency 694: Dispatcher */, {CONNECTION_OPEN: closure,
|
|
LOGOUT: closure, RELATIONSHIP_ADD: closure, RELATIONSHIP_REMOVE: closure,
|
|
GUILD_MEMBERS_CHUNK_BATCH: GUILD_MEMBERS_CHUNK_BATCH_96267});
|
|
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/relationships/GuildFriendshipStore.tsx');
|
|
exports.default = value;
|
|
}
|
|
|
|
function _isNativeReflectConstruct_96258() { // fn#96258, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12757:148, offset: 0x02159223, size: 98 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_96258_isNativeReflectConstruct = function() {
|
|
return !!result;
|
|
})();
|
|
}
|
|
|
|
function getFetchState(a0) { // fn#96261, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12757:470, offset: 0x02159285, size: 47 bytes, params: 2, frame: 5
|
|
return env0_8[a0]?.fetchState ?? env0_7.NOT_FETCHED;
|
|
}
|
|
|
|
function _fun96263(a0) { // fn#96263, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12757:606, offset: 0x021592b4, size: 101 bytes, params: 2, frame: 16
|
|
const closure = GuildFriendshipStore;
|
|
env0_6(closure, a0);
|
|
return env0_3(closure, [{key: 'isFetchingFriendsForGuild', value: value_96265},
|
|
{key: 'fetchFriendMembersIfNotFetched', value: value_96266}]);
|
|
}
|
|
|
|
function GUILD_MEMBERS_CHUNK_BATCH_96267({chunks}) { // fn#96267, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12757:1375, offset: 0x021593b0, size: 210 bytes, params: 2, frame: 18
|
|
var length;
|
|
var property2;
|
|
var foundMembers;
|
|
var property3;
|
|
var notFoundMembers;
|
|
let value = 0;
|
|
const property = chunks[value];
|
|
const guildId = property.guildId;
|
|
const fetchState = getFetchState(guildId);
|
|
const FETCHING = env0_7.FETCHING;
|
|
if (fetchState === FETCHING) {
|
|
property2 = env0_8[guildId];
|
|
foundMembers = property2.foundMembers;
|
|
length = property.members.length;
|
|
property2.foundMembers = foundMembers + length;
|
|
property3 = env0_8[guildId];
|
|
notFoundMembers = property3.notFoundMembers;
|
|
length = property.notFound?.length;
|
|
property3.notFoundMembers = notFoundMembers + (length ?? value);
|
|
foundMembers = env0_8[guildId].foundMembers;
|
|
notFoundMembers = env0_8[guildId].notFoundMembers;
|
|
value = foundMembers + notFoundMembers;
|
|
if (value >= env0_9) {
|
|
env0_8[guildId].fetchState = env0_7.FETCHED;
|
|
}
|
|
}
|
|
}
|
|
|
|
function value_96265(a0) { // fn#96265, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12757:951, offset: 0x02159319, size: 33 bytes, params: 2, frame: 12
|
|
const fetchState = getFetchState(a0);
|
|
const FETCHING = env1_7.FETCHING;
|
|
return fetchState === FETCHING;
|
|
}
|
|
|
|
function value_96266(a0, a1) { // fn#96266, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12757:1046, offset: 0x0215933a, size: 118 bytes, params: 3, frame: 17
|
|
var length;
|
|
const value = environment.__proto__;
|
|
const fetchState = getFetchState(a0);
|
|
const NOT_FETCHED = env1_7.NOT_FETCHED;
|
|
if (fetchState === NOT_FETCHED) {
|
|
env1_8[a0] = {'fetchState': null, 'foundMembers': 0, 'notFoundMembers': 0, fetchState: env1_7.FETCHING};
|
|
length = a1.length;
|
|
(importDefault(6593) /* metro dependency 6593: GuildActionCreators */).requestMembersById(a0, a1, false);
|
|
}
|
|
}
|
|
|