decord/source/modules/premium/GuildCapUpsellHooks.tsx

69 lines
2.6 KiB
TypeScript
Raw Normal View History

2026-08-25 06:04:03 +00:00
// Module ID: 5940
// Function ID: 5941
2026-07-29 08:29:29 +00:00
// Name: useShouldShowInlineGuildCapUpsell
2026-08-25 06:04:03 +00:00
// Dependencies: [1910, 1922, 676, 589, 5941, 4043, 2]
2026-07-29 08:29:29 +00:00
// Exports: hasIncreasedGuildCap, hideInlineGuildCapUpsell, isAtGuildCapAndNonPremium, useShouldShowInlineGuildCapUpsell
2026-07-20 16:05:17 +00:00
2026-08-25 06:04:03 +00:00
// Module 5940 (useShouldShowInlineGuildCapUpsell)
2026-08-24 06:08:38 +00:00
import initialize from "initialize" /* 589 */;
2026-08-25 06:04:03 +00:00
import getPremiumPlanItemDefault from "getPremiumPlanItem" /* 4043 */;
import HotspotStore2 from "HotspotStore" /* 5941 */;
2026-08-24 06:08:38 +00:00
import closure_3 from "createGuildRecordFromRust" /* 1910 */;
import closure_4 from "mergeGuildAvatar" /* 1922 */;
import { MAX_USER_GUILDS } from "ME" /* 676 */;
2026-07-23 10:11:24 +00:00
2026-08-24 06:08:38 +00:00
require = arg1;
let result = require("set").fileFinishedImporting("modules/premium/GuildCapUpsellHooks.tsx");
2026-07-20 16:05:17 +00:00
export const useShouldShowInlineGuildCapUpsell = function useShouldShowInlineGuildCapUpsell() {
2026-08-24 06:08:38 +00:00
const items = [closure_3];
let stateFromStores = initialize.useStateFromStores(items, () => guildCount.getGuildCount() >= 95);
const obj = initialize;
const items1 = [HotspotStore2.HotspotStore];
const stateFromStores1 = initialize.useStateFromStores(items1, () => {
2026-08-25 06:04:03 +00:00
const HotspotStore = callback(5941).HotspotStore;
return HotspotStore.hasHotspot(callback(5941).HotspotLocations.GUILD_CAP_INLINE_UPSELL);
2026-07-20 16:05:17 +00:00
});
2026-08-24 06:08:38 +00:00
const obj2 = initialize;
const items2 = [closure_4];
2026-08-25 06:04:03 +00:00
const stateFromStoresObject = initialize.useStateFromStoresObject(items2, () => !callback2(4043).isPremium(currentUser.getCurrentUser()));
2026-07-20 16:05:17 +00:00
if (stateFromStores) {
stateFromStores = stateFromStores1;
}
if (stateFromStores) {
stateFromStores = stateFromStoresObject;
}
return stateFromStores;
};
export const hideInlineGuildCapUpsell = function hideInlineGuildCapUpsell() {
2026-08-24 06:08:38 +00:00
HotspotStore2.hideHotspot(HotspotStore2.HotspotLocations.GUILD_CAP_INLINE_UPSELL);
2026-07-29 08:29:29 +00:00
};
export const hasIncreasedGuildCap = function hasIncreasedGuildCap(currentUser) {
2026-08-24 06:08:38 +00:00
let result = getPremiumPlanItemDefault.canUseIncreasedGuildCap(currentUser);
2026-07-29 08:29:29 +00:00
if (!result) {
let isStaffResult;
if (currentUser != null) {
isStaffResult = currentUser.isStaff();
}
result = true === isStaffResult;
}
return result;
2026-07-20 16:05:17 +00:00
};
export const isAtGuildCapAndNonPremium = function isAtGuildCapAndNonPremium() {
let tmp = guildCount.getGuildCount() >= MAX_USER_GUILDS;
if (tmp) {
2026-07-29 08:29:29 +00:00
currentUser = currentUser.getCurrentUser();
2026-08-24 06:08:38 +00:00
let result = getPremiumPlanItemDefault.canUseIncreasedGuildCap(currentUser);
2026-07-29 08:29:29 +00:00
if (!result) {
let isStaffResult;
if (currentUser != null) {
isStaffResult = currentUser.isStaff();
}
result = true === isStaffResult;
}
tmp = !result;
2026-08-24 06:08:38 +00:00
const obj2 = getPremiumPlanItemDefault;
2026-07-20 16:05:17 +00:00
}
return tmp;
};