decord/source/modules/premium/powerups/hooks/useIsGuildThemePerkEnabled.tsx

49 lines
1.5 KiB
TypeScript
Raw Normal View History

// Module ID: 16254
// Function ID: 16255
2026-07-20 16:05:17 +00:00
// Name: useIsGuildThemePerkEnabled
// Dependencies: [1979, 4525, 1074, 504, 4529, 2]
2026-07-20 16:05:17 +00:00
// Exports: default
// Module 16254 (useIsGuildThemePerkEnabled)
import Powerups from "Powerups" /* 4529 */;
import GuildStore from "GuildStore" /* 1979 */;
import GuildPowerupsStore from "GuildPowerupsStore" /* 4525 */;
2026-07-23 10:11:24 +00:00
const require = globalThis.__r;
require = fn;
const GuildFeatures = fn(1074).GuildFeatures;
const size = fn(2);
const result = size.fileFinishedImporting("modules/premium/powerups/hooks/useIsGuildThemePerkEnabled.tsx");
2026-07-20 16:05:17 +00:00
export default function useIsGuildThemePerkEnabled(arg0) {
_require = arg0;
const items = [GuildStore, GuildPowerupsStore];
2026-07-20 16:05:17 +00:00
const items1 = [arg0];
return require("initialize").useStateFromStores(items, () => {
let tmp2 = null != closure_0;
2026-07-29 08:29:29 +00:00
if (tmp2) {
const guild = GuildStore.getGuild(tmp);
2026-07-20 16:05:17 +00:00
let hasItem;
2026-07-29 08:29:29 +00:00
if (guild != null) {
2026-07-20 16:05:17 +00:00
const features = guild.features;
hasItem = features.has(GuildFeatures.GUILD_THEME);
2026-07-20 16:05:17 +00:00
}
let tmp7 = true === hasItem;
if (!tmp7) {
const stateForGuild = GuildPowerupsStore.getStateForGuild(tmp);
2026-07-29 08:29:29 +00:00
let tmp10;
if (stateForGuild != null) {
2026-07-20 16:05:17 +00:00
const unlockedPowerups = stateForGuild.unlockedPowerups;
2026-07-29 08:29:29 +00:00
if (unlockedPowerups != null) {
tmp10 = unlockedPowerups[Powerups.GUILD_POWERUP_GUILD_THEME_SKU_ID];
2026-07-20 16:05:17 +00:00
}
}
2026-07-29 08:29:29 +00:00
tmp7 = null != tmp10;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
tmp2 = tmp7;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
return tmp2;
2026-07-20 16:05:17 +00:00
}, items1);
};