Files
discord-decomp/sources/modules/premium/GuildCapUpsellHooks.tsx
T
2026-07-27 16:20:00 +03:00

74 lines
4.2 KiB
TypeScript

/* Metro module 6823; source: modules/premium/GuildCapUpsellHooks.tsx; dependencies: [1867, 1878, 661, 566, 6824, 3802, 2] */
function _fun53635(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#53635, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7001:6, offset: 0x0135204c, size: 195 bytes, params: 8, frame: 20
const env0_0 = require;
const closure = hasIncreasedGuildCap;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const guildStore = importDefault(1867) /* metro dependency 1867: GuildStore */;
const userStore = importDefault(1878) /* metro dependency 1878: UserStore */;
const env0_5 = (require(661) /* metro dependency 661: Constants */).MAX_USER_GUILDS;
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/premium/GuildCapUpsellHooks.tsx');
exports.useShouldShowInlineGuildCapUpsell = useShouldShowInlineGuildCapUpsell;
exports.hideInlineGuildCapUpsell = hideInlineGuildCapUpsell;
exports.hasIncreasedGuildCap = closure;
exports.isAtGuildCapAndNonPremium = isAtGuildCapAndNonPremium;
}
function hasIncreasedGuildCap(a0) { // fn#53636, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7001:142, offset: 0x0135210f, size: 71 bytes, params: 2, frame: 12
var r0;
let value = undefined;
const canUseIncreasedGuildCap2 = (importDefault(3802) /* metro dependency 3802: PremiumUtils */).canUseIncreasedGuildCap(a0);
if (canUseIncreasedGuildCap2) {
r0 = canUseIncreasedGuildCap2;
} else {
value = (a0 == null ? value : a0.isStaff()) === true;
r0 = value;
}
return r0;
}
function useShouldShowInlineGuildCapUpsell() { // fn#53637, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7001:361, offset: 0x01352156, size: 158 bytes, params: 1, frame: 20
const fluxModule = require(566) /* metro dependency 566: flux */;
let useStateFromStores = fluxModule.useStateFromStores;
const value2 = Reflect.apply(useStateFromStores, fluxModule, [[GuildStore], _fun53638]);
const moduleValue2 = fluxModule;
useStateFromStores = moduleValue2.useStateFromStores;
let HotspotStore = (require(6824) /* metro dependency 6824: hotspot */).HotspotStore;
return value2 && Reflect.apply(useStateFromStores, moduleValue2, [[HotspotStore], function() {
var HotspotStore = require(dependencyMap[4]).HotspotStore;
return HotspotStore.hasHotspot(require(dependencyMap[4]).HotspotLocations.GUILD_CAP_INLINE_UPSELL);
}]) && fluxModule.useStateFromStoresObject([UserStore], function() {
return !importDefault(dependencyMap[5]).isPremium(UserStore.getCurrentUser());
});
}
function hideInlineGuildCapUpsell() { // fn#53641, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7001:741, offset: 0x01352285, size: 59 bytes, params: 1, frame: 14
const value = require(6824) /* metro dependency 6824: hotspot */;
const hideHotspot = value.hideHotspot;
const HotspotLocations = (require(6824) /* metro dependency 6824: hotspot */).HotspotLocations;
const GUILD_CAP_INLINE_UPSELL = HotspotLocations.GUILD_CAP_INLINE_UPSELL;
Reflect.apply(hideHotspot, value, [GUILD_CAP_INLINE_UPSELL]);
}
function isAtGuildCapAndNonPremium() { // fn#53642, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7001:920, offset: 0x013522c0, size: 57 bytes, params: 1, frame: 12
var r0;
var hasIncreasedGuildCapBinding;
var value;
const value3 = GuildStore.getGuildCount() >= MAX_USER_GUILDS;
if (value3) {
hasIncreasedGuildCapBinding = hasIncreasedGuildCap;
value = UserStore.getCurrentUser();
value = !hasIncreasedGuildCapBinding(value);
r0 = value;
} else {
r0 = value3;
}
return r0;
}
function _fun53638() { // fn#53638, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7001:444, offset: 0x013521f4, size: 26 bytes, params: 1, frame: 9
const value = environment.__proto__;
return GuildStore.getGuildCount() >= 95;
}