Files
discord-decomp/modules/guild_onboarding_home/GuildOnboardingMemberActionStore.tsx
T
2026-11-01 12:12:55 +02:00

64 lines
1.9 KiB
TypeScript

// Metro module 4392 (f4393).
import Module589 from "../../_bundle/Module589";
import Dispatcher from "../../Dispatcher";
let c2624_0 = {};
let c2624_1 = {};
let c2624_2 = new Set();
class GuildOnboardingMemberActionStore extends Module589.Store {
static displayName = "GuildOnboardingMemberActionStore";
getCompletedActions(a0) {
return a0 != null ? c2624_1[a0] : null;
}
hasCompletedActionForChannel(a0, a1) {
const completedActions = this.getCompletedActions(a0);
return completedActions != null && completedActions[a1] != null;
}
getState(a0) {
return a0 == null ? {} : {
completedActions: c2624_1[a0],
loading: c2624_2.has(a0)
};
}
}
const guildOnboardingMemberActionStore = new GuildOnboardingMemberActionStore(Dispatcher, {
GUILD_NEW_MEMBER_ACTIONS_FETCH_START: function handleMemberActionsFetchStart(a0) {
c2624_2.add(a0.guildId);
},
GUILD_NEW_MEMBER_ACTIONS_FETCH_SUCCESS: function handleMemberActionsFetchSuccess({ memberActions, guildId }) {
if (memberActions != null) {
c2624_1[guildId] = memberActions;
c2624_2.delete(guildId);
} else {
c2624_1[guildId] = c2624_0;
}
},
GUILD_NEW_MEMBER_ACTIONS_FETCH_FAIL: function handleMemberActionsFetchFail(a0) {
c2624_2.delete(a0.guildId);
},
GUILD_NEW_MEMBER_ACTIONS_DELETE_SUCCESS: function handleNewMemberActionsDelete({ guildId }) {
if (c2624_1[guildId] == null) {
return false;
}
delete c2624_1[guildId];
},
COMPLETE_NEW_MEMBER_ACTION: function handleCompleteNewMemberAction({ guildId, channelId }) {
const r9 = {
...c2624_1
};
const r10 = {
...c2624_1[guildId]
};
r10[channelId] = true;
r9[guildId] = r10;
c2624_1 = r9;
},
GUILD_DELETE: function handleGuildDelete({ guild }) {
if (c2624_1[guild.id] == null) {
return false;
}
delete c2624_1[guild.id];
}
});
export default guildOnboardingMemberActionStore;
export { c2624_0 as NO_ACTIONS };