decord/alpha/source/stores/AppliedGuildBoostStore.tsx

121 lines
3.7 KiB
TypeScript
Raw Permalink Normal View History

2026-10-13 12:43:34 +00:00
// Module ID: 12813
// Function ID: 12814
// Name: AppliedGuildBoostStore
2026-10-03 08:58:59 +00:00
// Dependencies: [504, 584, 2]
2026-07-23 10:11:24 +00:00
2026-10-13 12:43:34 +00:00
// Module 12813 (AppliedGuildBoostStore)
2026-10-03 08:58:59 +00:00
import get_initializedDefault from "get initialized" /* 504 */;
import DispatcherDefault from "Dispatcher" /* 584 */;
import size from "module_2" /* 2 */;
let closure_0, closure_2, set;
2026-07-20 16:05:17 +00:00
function handleModifyingAppliedBoostStart() {
2026-08-24 06:08:38 +00:00
c4 = true;
2026-07-20 16:05:17 +00:00
}
2026-10-03 08:58:59 +00:00
const React = {};
let endsAt = null;
2026-10-03 08:58:59 +00:00
const React2 = [];
2026-07-29 08:29:29 +00:00
let c3 = false;
let c4 = false;
let error = null;
2026-10-03 08:58:59 +00:00
const Store = get_initializedDefault.Store;
2026-07-29 08:29:29 +00:00
class AppliedGuildBoostStore extends Store {
2026-10-03 08:58:59 +00:00
getAppliedGuildBoostsForGuild(arg0) {
let subscriptions = null;
if (null != closure_0[arg0]) {
subscriptions = closure_0[arg0].subscriptions;
}
return subscriptions;
2026-07-20 16:05:17 +00:00
}
2026-10-03 08:58:59 +00:00
getLastFetchedAtForGuild(arg0) {
let lastFetchedAt = null;
if (null != closure_0[arg0]) {
lastFetchedAt = closure_0[arg0].lastFetchedAt;
}
return lastFetchedAt;
2026-07-29 08:29:29 +00:00
}
2026-10-03 08:58:59 +00:00
getCurrentUserAppliedBoosts() {
return closure_2;
}
getAppliedGuildBoost(arg0) {
closure_0 = arg0;
return closure_2.find((id) => id.id === closure_0);
}
}
const prototype = AppliedGuildBoostStore.prototype;
2026-07-29 08:29:29 +00:00
Object.defineProperty(prototype, "isModifyingAppliedBoost", {
get: function isModifyingAppliedBoost() {
return c4;
},
set: undefined
});
Object.defineProperty(prototype, "applyBoostError", {
get: function applyBoostError() {
return error;
2026-07-29 08:29:29 +00:00
},
set: undefined
});
Object.defineProperty(prototype, "unapplyBoostError", {
get: function unapplyBoostError() {
return error;
2026-07-29 08:29:29 +00:00
},
set: undefined
});
Object.defineProperty(prototype, "cooldownEndsAt", {
get: function cooldownEndsAt() {
return endsAt;
2026-07-29 08:29:29 +00:00
},
set: undefined
});
Object.defineProperty(prototype, "isFetchingCurrentUserAppliedBoosts", {
get: function isFetchingCurrentUserAppliedBoosts() {
return c3;
},
set: undefined
});
AppliedGuildBoostStore.displayName = "AppliedGuildBoostStore";
2026-10-13 12:43:34 +00:00
const obj = {
2026-07-20 16:05:17 +00:00
GUILD_APPLIED_BOOSTS_FETCH_SUCCESS: function handleAppliedBoostsForGuildFetchSuccess(appliedBoosts) {
2026-07-29 08:29:29 +00:00
closure_0[appliedBoosts.guildId] = { subscriptions: appliedBoosts.appliedBoosts, lastFetchedAt: Date.now() };
2026-10-03 08:58:59 +00:00
({ subscriptions: appliedBoosts.appliedBoosts, lastFetchedAt: Date.now() });
2026-07-20 16:05:17 +00:00
},
USER_APPLIED_BOOSTS_FETCH_SUCCESS: function handleAppliedBoostsForuserFetchSuccess(appliedGuildBoosts) {
2026-08-24 06:08:38 +00:00
c3 = false;
2026-07-20 16:05:17 +00:00
appliedGuildBoosts = appliedGuildBoosts.appliedGuildBoosts;
},
APPLIED_BOOSTS_COOLDOWN_FETCH_SUCCESS: function handleAppliedBoostCooldownFetch(endsAt) {
endsAt = endsAt.endsAt;
},
GUILD_UNAPPLY_BOOST_START: handleModifyingAppliedBoostStart,
GUILD_APPLY_BOOST_START: handleModifyingAppliedBoostStart,
GUILD_APPLY_BOOST_SUCCESS: function handleApplyBoostSuccess(appliedGuildBoost) {
appliedGuildBoost = appliedGuildBoost.appliedGuildBoost;
2026-10-03 08:58:59 +00:00
set = new Set(appliedGuildBoost.map((id) => id.id));
const items = [...appliedGuildBoost, ...closure_2.filter((id) => !set.has(id.id))];
closure_2 = items;
error = null;
2026-08-24 06:08:38 +00:00
c4 = false;
2026-07-20 16:05:17 +00:00
},
GUILD_APPLY_BOOST_FAIL: function handleApplyBoostFail(error) {
2026-08-24 06:08:38 +00:00
c4 = false;
2026-07-20 16:05:17 +00:00
error = error.error;
},
GUILD_UNAPPLY_BOOST_SUCCESS: function handleUnapplyBoostSuccess(boostId) {
boostId = boostId.boostId;
2026-07-29 08:29:29 +00:00
closure_2 = closure_2.filter((id) => id.id !== boostId);
2026-08-24 06:08:38 +00:00
c4 = false;
2026-07-20 16:05:17 +00:00
},
GUILD_UNAPPLY_BOOST_FAIL: function handleUnapplyBoostFail(error) {
2026-08-24 06:08:38 +00:00
c4 = false;
2026-07-20 16:05:17 +00:00
error = error.error;
},
USER_APPLIED_BOOSTS_FETCH_START: function handleUserAppliedBoostsFetchStart() {
2026-08-24 06:08:38 +00:00
c3 = true;
2026-07-20 16:05:17 +00:00
}
2026-10-03 08:58:59 +00:00
};
const appliedGuildBoostStore = new AppliedGuildBoostStore(DispatcherDefault, obj);
const result = size.fileFinishedImporting("stores/AppliedGuildBoostStore.tsx");
2026-07-20 16:05:17 +00:00
2026-07-29 08:29:29 +00:00
export default appliedGuildBoostStore;