decord/alpha/source/modules/relationships/GuildFriendshipStore.tsx

86 lines
2.7 KiB
TypeScript
Raw Normal View History

2026-10-06 11:16:32 +00:00
// Module ID: 13550
// Function ID: 13551
// Name: GuildFriendshipStore
2026-10-06 11:16:32 +00:00
// Dependencies: [504, 5712, 584, 2]
2026-07-23 10:11:24 +00:00
2026-10-06 11:16:32 +00:00
// Module 13550 (GuildFriendshipStore)
2026-10-03 08:58:59 +00:00
import get_initializedDefault from "get initialized" /* 504 */;
import DispatcherDefault from "Dispatcher" /* 584 */;
2026-10-06 11:16:32 +00:00
import GuildActionCreatorsDefault from "GuildActionCreators" /* 5712 */;
2026-10-03 08:58:59 +00:00
import size from "module_2" /* 2 */;
let closure_3;
2026-07-20 16:05:17 +00:00
2026-07-29 08:29:29 +00:00
function resetStates() {
2026-08-24 06:08:38 +00:00
closure_3 = {};
2026-07-20 16:05:17 +00:00
}
2026-10-03 08:58:59 +00:00
const React2 = { NOT_FETCHED: 0, [0]: "NOT_FETCHED", FETCHING: 1, [1]: "FETCHING", FETCHED: 2, [2]: "FETCHED" };
const _false = {};
const length = 0;
const Store = get_initializedDefault.Store;
2026-07-29 08:29:29 +00:00
class GuildFriendshipStore extends Store {
2026-10-03 08:58:59 +00:00
isFetchingFriendsForGuild(arg0) {
let fetchState;
if (closure_3[arg0] != null) {
fetchState = tmp.fetchState;
}
if (fetchState == null) {
fetchState = constants.NOT_FETCHED;
}
return fetchState === constants.FETCHING;
2026-07-29 08:29:29 +00:00
}
2026-10-03 08:58:59 +00:00
fetchFriendMembersIfNotFetched(id1, items) {
let fetchState;
if (closure_3[id1] != null) {
fetchState = tmp.fetchState;
}
if (fetchState == null) {
fetchState = constants.NOT_FETCHED;
}
if (fetchState === constants.NOT_FETCHED) {
const obj = { fetchState: tmp4.FETCHING, foundMembers: 0, notFoundMembers: 0 };
closure_3[id1] = obj;
const obj2 = GuildActionCreatorsDefault;
const membersById = obj2.requestMembersById(id1, items, false);
}
2026-07-29 08:29:29 +00:00
}
2026-10-03 08:58:59 +00:00
}
const prototype = GuildFriendshipStore.prototype;
let obj = {
2026-07-20 16:05:17 +00:00
CONNECTION_OPEN: resetStates,
LOGOUT: resetStates,
RELATIONSHIP_ADD: resetStates,
RELATIONSHIP_REMOVE: resetStates,
GUILD_MEMBERS_CHUNK_BATCH: function onMemberChunk(arg0) {
const first = arg0.chunks[0];
const guildId = first.guildId;
2026-07-29 08:29:29 +00:00
let fetchState;
2026-10-03 08:58:59 +00:00
if (closure_3[guildId] != null) {
2026-07-29 08:29:29 +00:00
fetchState = tmp2.fetchState;
}
if (fetchState == null) {
fetchState = constants.NOT_FETCHED;
}
if (fetchState === constants.FETCHING) {
2026-10-03 08:58:59 +00:00
closure_3[guildId].foundMembers = closure_3[guildId].foundMembers + first.members.length;
2026-07-20 16:05:17 +00:00
const notFound = first.notFound;
2026-07-29 08:29:29 +00:00
let num;
2026-10-03 08:58:59 +00:00
const notFoundMembers = tmp13.notFoundMembers;
2026-07-29 08:29:29 +00:00
if (notFound != null) {
num = notFound.length;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
if (num == null) {
num = 0;
2026-07-20 16:05:17 +00:00
}
2026-10-03 08:58:59 +00:00
closure_3[guildId].notFoundMembers = notFoundMembers + num;
if (closure_3[guildId].foundMembers + closure_3[guildId].notFoundMembers >= length) {
closure_3[guildId].fetchState = tmp5.FETCHED;
2026-07-20 16:05:17 +00:00
}
}
}
2026-10-03 08:58:59 +00:00
};
const guildFriendshipStore = new GuildFriendshipStore(DispatcherDefault, obj);
const result = size.fileFinishedImporting("modules/relationships/GuildFriendshipStore.tsx");
2026-07-20 16:05:17 +00:00
2026-07-29 08:29:29 +00:00
export default guildFriendshipStore;