decord/source/modules/relationships/GuildFriendshipStore.tsx
github-actions 20a21ad13f chore: update source for alpha 346.5
Skipped 1 file(s) >100MB (GitHub limit): source/__polyfill/04xxx/module_4791.js (118.4 MB)
2026-09-11 19:12:58 +00:00

79 lines
2.7 KiB
TypeScript

// Module ID: 13778
// Function ID: 13779
// Name: GuildFriendshipStore
// Dependencies: [504, 5571, 573, 2]
// Module 13778 (GuildFriendshipStore)
import initializeDefault from "initialize" /* 504 */;
import DispatcherDefault from "Dispatcher" /* 573 */;
import GuildActionCreatorsDefault from "GuildActionCreators" /* 5571 */;
function resetStates() {
closure_3 = {};
}
const constants = { NOT_FETCHED: 0, [0]: "NOT_FETCHED", FETCHING: 1, [1]: "FETCHING", FETCHED: 2, [2]: "FETCHED" };
const dependencyMap = {};
const Store = initializeDefault.Store;
class GuildFriendshipStore extends Store {
}
const prototype = GuildFriendshipStore.prototype;
prototype["isFetchingFriendsForGuild"] = function isFetchingFriendsForGuild(arg0) {
let fetchState;
if (dependencyMap[arg0] != null) {
fetchState = tmp.fetchState;
}
if (fetchState == null) {
fetchState = constants.NOT_FETCHED;
}
return fetchState === constants.FETCHING;
};
prototype["fetchFriendMembersIfNotFetched"] = function fetchFriendMembersIfNotFetched(id1, items) {
let fetchState;
if (dependencyMap[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 };
dependencyMap[id1] = obj;
const membersById = GuildActionCreatorsDefault.requestMembersById(id1, items, false);
}
};
const guildFriendshipStore = new GuildFriendshipStore(DispatcherDefault, {
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;
let fetchState;
if (dependencyMap[guildId] != null) {
fetchState = tmp2.fetchState;
}
if (fetchState == null) {
fetchState = constants.NOT_FETCHED;
}
if (fetchState === constants.FETCHING) {
dependencyMap[guildId].foundMembers = dependencyMap[guildId].foundMembers + first.members.length;
const notFound = first.notFound;
let num;
if (notFound != null) {
num = notFound.length;
}
if (num == null) {
num = 0;
}
dependencyMap[guildId].notFoundMembers = dependencyMap[guildId].notFoundMembers + num;
if (dependencyMap[guildId].foundMembers + dependencyMap[guildId].notFoundMembers >= length) {
dependencyMap[guildId].fetchState = tmp5.FETCHED;
}
}
}
});
const size = fn(2);
const result = size.fileFinishedImporting("modules/relationships/GuildFriendshipStore.tsx");
export default guildFriendshipStore;