130 lines
6.8 KiB
TypeScript
130 lines
6.8 KiB
TypeScript
/* Metro module 12567; source: modules/relationships/GuildFriendshipStore.tsx; dependencies: [6, 7, 15, 17, 18, 6593, 566, 694, 2] */
|
|
import ClassCallCheck from '../../by-id/module-00006-ClassCallCheck.js'; /* Metro dependency 6 */
|
|
import CreateClass from '../../by-id/module-00007-CreateClass.js'; /* Metro dependency 7 */
|
|
import PossibleConstructorReturn from '../../by-id/module-00015-PossibleConstructorReturn.js'; /* Metro dependency 15 */
|
|
import Module00017 from '../../by-id/module-00017.js'; /* Metro dependency 17 */
|
|
import Inherits from '../../by-id/module-00018-Inherits.js'; /* Metro dependency 18 */
|
|
import Flux from '../../external/discord_common/js/packages/flux/index.tsx'; /* Metro dependency 566 */
|
|
import * as FileImportTrackerModule from '../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 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
|
|
const closure = function() {
|
|
env0_8 = {};
|
|
};
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
object = {NOT_FETCHED: 0};
|
|
object[0] = 'NOT_FETCHED';
|
|
object.FETCHING = 1;
|
|
object[1] = 'FETCHING';
|
|
object.FETCHED = 2;
|
|
object[2] = 'FETCHED';
|
|
let env0_8 = {};
|
|
const Store = (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});
|
|
(FileImportTrackerModule).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 GuildFriendshipStore2 = GuildFriendshipStore;
|
|
Inherits(GuildFriendshipStore2, a0);
|
|
return CreateClass(GuildFriendshipStore2, [{key: 'isFetchingFriendsForGuild', value: value_96265},
|
|
{key: 'fetchFriendMembersIfNotFetched', value: value_96266}]);
|
|
function GuildFriendshipStore() { // fn#96264, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12757:618, offset: 0x00ec62ac, size: 113 bytes, params: 1, frame: 20
|
|
const value = environment.__proto__;
|
|
env1_2(this, GuildFriendshipStore);
|
|
const value3 = env1_5(GuildFriendshipStore);
|
|
return env1_4(this, _isNativeReflectConstruct_96258() ? global.Reflect.construct(value3, arguments,
|
|
env1_5(this).constructor) : value3.apply(this, arguments));
|
|
}
|
|
|
|
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);
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
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;
|
|
}
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
global.__d(_fun96257, 12567, [6, 7, 15, 17, 18, 6593, 566, 694,
|
|
2]) /* metro module 12567, dependencies: [6, 7, 15, 17, 18, 6593, 566, 694, 2] */;
|