decord/source/modules/collectibles/hooks/useCanPurchaseFrames.tsx
2026-07-27 11:26:19 +00:00

62 lines
3 KiB
TypeScript

// Module ID: 8632
// Function ID: 68618
// Name: isUserPaidTier2
// Dependencies: [1850, 1852, 8031, 8633, 1873, 1868, 566, 2]
// Exports: default, useCanViewProfileFramesInCollectiblesShop, useIsProfileFramesEarlyAccessPhase
// Module 8632 (isUserPaidTier2)
import _isNativeReflectConstruct from "_isNativeReflectConstruct";
import { PremiumTypes } from "GuildFeatures";
const require = arg1;
function isUserPaidTier2(currentUser) {
let isPremiumExactlyResult = require(1873) /* isPremiumAtLeast */.isPremiumExactly(currentUser, PremiumTypes.TIER_2);
if (isPremiumExactlyResult) {
let premiumState;
if (null != currentUser) {
premiumState = currentUser.premiumState;
}
isPremiumExactlyResult = null != premiumState;
}
if (isPremiumExactlyResult) {
isPremiumExactlyResult = currentUser.premiumState.premiumSubscriptionType === require(1868) /* _callSuper */.PremiumSubscriptionType.TIER_2;
}
return isPremiumExactlyResult;
}
const result = require("apexExperiment").fileFinishedImporting("modules/collectibles/hooks/useCanPurchaseFrames.tsx");
export default function useCanPurchaseFrames(location) {
let obj = require(8031) /* apexExperiment */;
let isProfileFramesEnabled = obj.useIsProfileFramesEnabled(location);
obj = { location };
const bucket = importDefault(8633).useConfig(obj).bucket;
const obj2 = importDefault(8633);
const items = [_isNativeReflectConstruct];
const stateFromStores = require(566) /* initialize */.useStateFromStores(items, () => outer1_5(outer1_3.getCurrentUser()));
let tmp3 = bucket === require(8633) /* apexExperiment */.ProfileFramesPurchaseBucket.OPEN_PURCHASE;
if (!tmp3) {
tmp3 = bucket === require(8633) /* apexExperiment */.ProfileFramesPurchaseBucket.PAID_PREMIUM_SUBSCRIBERS_ONLY && stateFromStores;
const tmp6 = bucket === require(8633) /* apexExperiment */.ProfileFramesPurchaseBucket.PAID_PREMIUM_SUBSCRIBERS_ONLY && stateFromStores;
}
if (isProfileFramesEnabled) {
isProfileFramesEnabled = tmp3;
}
return isProfileFramesEnabled;
};
export const useCanViewProfileFramesInCollectiblesShop = function useCanViewProfileFramesInCollectiblesShop(UserProfileFrameEditButton) {
let isProfileFramesEnabled = require(8031) /* apexExperiment */.useIsProfileFramesEnabled(UserProfileFrameEditButton);
importDefault(8633);
if (isProfileFramesEnabled) {
isProfileFramesEnabled = tmp3 !== require(8633) /* apexExperiment */.ProfileFramesPurchaseBucket.CONTROL;
}
return isProfileFramesEnabled;
};
export const useIsProfileFramesEarlyAccessPhase = function useIsProfileFramesEarlyAccessPhase(CollectiblesShopCardCardDetailsV2) {
let isProfileFramesEnabled = require(8031) /* apexExperiment */.useIsProfileFramesEnabled(CollectiblesShopCardCardDetailsV2);
importDefault(8633);
if (isProfileFramesEnabled) {
isProfileFramesEnabled = tmp3 === require(8633) /* apexExperiment */.ProfileFramesPurchaseBucket.PAID_PREMIUM_SUBSCRIBERS_ONLY;
}
return isProfileFramesEnabled;
};
export { isUserPaidTier2 };