decord/source/modules/guild_onboarding/GuildOnboardingStore.tsx

101 lines
3.2 KiB
TypeScript
Raw Normal View History

// Module ID: 7148
// Function ID: 7149
// Name: GuildOnboardingStore
// Dependencies: [1074, 504, 1982, 573, 2]
2026-07-29 08:29:29 +00:00
// Exports: isOnboarding
2026-07-20 16:05:17 +00:00
// Module 7148 (GuildOnboardingStore)
import initializeDefault from "initialize" /* 504 */;
import DispatcherDefault from "Dispatcher" /* 573 */;
import Constants from "Constants" /* 1074 */;
import FavoritesUtils from "FavoritesUtils" /* 1982 */;
import size from "module_2" /* 2 */;
2026-07-23 10:11:24 +00:00
const ME = Constants.ME;
const GuildOnboardingStatus = { STARTED: "started", READY: "ready", COMPLETED: "completed", NOT_APPLICABLE: "not_applicable" };
const dependencyMap = {};
2026-07-29 08:29:29 +00:00
let closure_5 = {};
2026-08-24 06:08:38 +00:00
const Store = initializeDefault.Store;
2026-07-29 08:29:29 +00:00
class GuildOnboardingStore extends Store {
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
const prototype = GuildOnboardingStore.prototype;
prototype["shouldShowOnboarding"] = function shouldShowOnboarding(guildId) {
let tmp = guildId !== ME;
2026-07-29 08:29:29 +00:00
if (tmp) {
const obj = FavoritesUtils;
tmp = !obj.isFavoritesGuildId(guildId);
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
if (tmp) {
let hasItem = null != tmp5;
if (hasItem) {
const items = [, ];
({ STARTED: arr[0], READY: arr[1] } = obj);
hasItem = items.includes(tmp5);
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
tmp = hasItem;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
return tmp;
};
prototype["getOnboardingStatus"] = function getOnboardingStatus(guildId) {
return dependencyMap[guildId];
};
prototype["resetOnboardingStatus"] = function resetOnboardingStatus(arg0) {
closure_4[arg0] = obj.STARTED;
closure_5[arg0] = "cover";
};
prototype["getCurrentOnboardingStep"] = function getCurrentOnboardingStep(arg0) {
let str = closure_5[arg0];
2026-07-29 08:29:29 +00:00
if (str == null) {
str = "cover";
}
return str;
};
GuildOnboardingStore.displayName = "GuildOnboardingStore";
const guildOnboardingStore = new GuildOnboardingStore(DispatcherDefault, {
2026-07-20 16:05:17 +00:00
LOGOUT: function handleReset() {
2026-08-24 06:08:38 +00:00
closure_4 = {};
closure_5 = {};
2026-07-20 16:05:17 +00:00
},
GUILD_DELETE: function handleDelete(guild) {
guild = guild.guild;
2026-07-23 10:11:24 +00:00
delete tmp4[tmp3];
delete tmp2[tmp];
2026-07-20 16:05:17 +00:00
},
GUILD_ONBOARDING_START: function handleOnboardingStart(guildId) {
2026-07-29 08:29:29 +00:00
closure_4[guildId.guildId] = obj.STARTED;
2026-07-20 16:05:17 +00:00
},
GUILD_ONBOARDING_PROMPTS_FETCH_SUCCESS: function handlePromptsFetchSuccess(guildId) {
guildId = guildId.guildId;
2026-07-29 08:29:29 +00:00
if (dependencyMap[guildId] !== obj.STARTED) {
2026-07-20 16:05:17 +00:00
return false;
} else {
2026-07-29 08:29:29 +00:00
dependencyMap[guildId] = tmp ? tmp2.READY : tmp2.NOT_APPLICABLE;
2026-07-20 16:05:17 +00:00
}
},
GUILD_ONBOARDING_PROMPTS_FETCH_FAILURE: function handlePromptsFetchFailure(guildId) {
2026-07-29 08:29:29 +00:00
closure_4[guildId.guildId] = obj.NOT_APPLICABLE;
2026-07-20 16:05:17 +00:00
},
GUILD_ONBOARDING_COMPLETE: function handleCompleteOnboarding(guildId) {
2026-07-29 08:29:29 +00:00
closure_4[guildId.guildId] = obj.COMPLETED;
2026-07-20 16:05:17 +00:00
},
GUILD_ONBOARDING_SET_STEP: function handleOnboardingStep(guildId) {
2026-07-29 08:29:29 +00:00
closure_5[guildId.guildId] = guildId.step;
2026-07-20 16:05:17 +00:00
},
CONNECTION_OPEN: function handleResetOnboardingStep() {
2026-08-24 06:08:38 +00:00
closure_5 = {};
2026-07-20 16:05:17 +00:00
}
});
const result = size.fileFinishedImporting("modules/guild_onboarding/GuildOnboardingStore.tsx");
2026-07-20 16:05:17 +00:00
2026-07-29 08:29:29 +00:00
export default guildOnboardingStore;
export { GuildOnboardingStatus };
2026-07-29 08:29:29 +00:00
export const isOnboarding = function isOnboarding(arg0) {
let hasItem = null != arg0;
if (hasItem) {
const items = [, ];
({ STARTED: arr[0], READY: arr[1] } = obj);
hasItem = items.includes(arg0);
}
return hasItem;
};