49 lines
1.2 KiB
TypeScript
49 lines
1.2 KiB
TypeScript
// Metro module 11744 (f11745).
|
|
import Module589 from "../../_bundle/Module589";
|
|
import Dispatcher from "../../Dispatcher";
|
|
let c8044_0 = {};
|
|
class GuildPromptsStore extends Module589.PersistedStore {
|
|
static displayName = "GuildPromptsStore";
|
|
static persistKey = "GuildPromptsStore";
|
|
initialize(a0) {
|
|
for (const key in a0) {
|
|
c8044_0[key] = new Set(a0[key]);
|
|
}
|
|
}
|
|
hasViewedPrompt(a0, a1) {
|
|
const r4 = c8044_0[a1];
|
|
return r4 != null && !!r4.has(a0);
|
|
}
|
|
getState() {
|
|
return c8044_0;
|
|
}
|
|
}
|
|
const guildPromptsStore = new GuildPromptsStore(Dispatcher, {
|
|
GUILD_PROMPT_VIEWED: function handleGuildPromptViewed({ prompt, guildId }) {
|
|
let r12;
|
|
const r6 = c8044_0[guildId];
|
|
if (r6 == null) {
|
|
c8044_0[guildId] = new Set();
|
|
c8044_0[guildId].add(prompt);
|
|
r12 = true;
|
|
} else {
|
|
const r11 = r6.has(prompt);
|
|
r12 = !r11;
|
|
if (!r11) {
|
|
r6.add(prompt);
|
|
r12 = true;
|
|
}
|
|
}
|
|
return r12;
|
|
},
|
|
GUILD_DELETE: function handleGuildDelete({ guild }) {
|
|
let r8 = c8044_0[guild.id] != null && !guild.unavailable;
|
|
if (r8) {
|
|
delete c8044_0[guild.id];
|
|
r8 = true;
|
|
}
|
|
return r8;
|
|
}
|
|
});
|
|
export default guildPromptsStore;
|