decord/source/modules/guild_profile/GuildPopoutStore.tsx

73 lines
2.4 KiB
TypeScript
Raw Normal View History

// Module ID: 14043
// Function ID: 14044
// Name: GuildPopoutStore
// Dependencies: [502, 7393, 504, 573, 2]
2026-07-20 16:05:17 +00:00
// Module 14043 (GuildPopoutStore)
import initializeDefault from "initialize" /* 504 */;
import DispatcherDefault from "Dispatcher" /* 573 */;
import GuildDiscoveryUtils from "GuildDiscoveryUtils" /* 7393 */;
import AuthenticationStore from "AuthenticationStore" /* 502 */;
2026-07-23 10:11:24 +00:00
require = fn;
const constants = { UNSET: "unset", FETCHING: "fetching", FAILED: "failed", SUCCEEDED: "succeeded" };
2026-07-29 08:29:29 +00:00
let closure_4 = { guilds: {} };
2026-08-24 06:08:38 +00:00
const Store = initializeDefault.Store;
2026-07-29 08:29:29 +00:00
class GuildPopoutStore extends Store {
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
const prototype = GuildPopoutStore.prototype;
prototype["initialize"] = function initialize() {
this.waitFor(AuthenticationStore);
2026-07-29 08:29:29 +00:00
};
prototype["isFetchingGuild"] = function isFetchingGuild(arg0) {
let tmp2 = null != tmp;
if (tmp2) {
tmp2 = tmp.fetchState === constants.FETCHING;
}
return tmp2;
};
prototype["getGuild"] = function getGuild(arg0) {
let guild = null;
if (null != closure_4.guilds[arg0]) {
guild = tmp.guild;
}
return guild;
};
prototype["hasFetchFailed"] = function hasFetchFailed(arg0) {
let tmp2 = null != tmp;
if (tmp2) {
tmp2 = tmp.fetchState === constants.FAILED;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
return tmp2;
};
GuildPopoutStore.displayName = "GuildPopoutStore";
const guildPopoutStore = new GuildPopoutStore(DispatcherDefault, {
2026-07-20 16:05:17 +00:00
GUILD_POPOUT_FETCH_START: function handleFetchStart(guildId) {
guildId = guildId.guildId;
const obj = {};
2026-07-29 08:29:29 +00:00
const merged = Object.assign(closure_4.guilds[guildId]);
obj.fetchState = constants.FETCHING;
closure_4.guilds[guildId] = obj;
2026-07-20 16:05:17 +00:00
},
GUILD_POPOUT_FETCH_SUCCESS: function handleFetchSuccess(guildId) {
guildId = guildId.guildId;
const obj2 = {};
const discoverableGuild = GuildDiscoveryUtils.makeDiscoverableGuild(guildId.guild);
2026-07-29 08:29:29 +00:00
const merged = Object.assign(closure_4.guilds[guildId]);
obj2.guild = discoverableGuild;
obj2.fetchState = constants.SUCCEEDED;
closure_4.guilds[guildId] = obj2;
2026-07-20 16:05:17 +00:00
},
GUILD_POPOUT_FETCH_FAILURE: function handleFetchFailure(guildId) {
guildId = guildId.guildId;
const obj = {};
2026-07-29 08:29:29 +00:00
const merged = Object.assign(closure_4.guilds[guildId]);
obj.fetchState = constants.FAILED;
closure_4.guilds[guildId] = obj;
2026-07-20 16:05:17 +00:00
}
});
const size = fn(2);
const result = size.fileFinishedImporting("modules/guild_profile/GuildPopoutStore.tsx");
2026-07-20 16:05:17 +00:00
2026-07-29 08:29:29 +00:00
export default guildPopoutStore;