decord/source/modules/rewards/hooks/useHasXboxMonthlyOrbsPerk.tsx
github-actions ecf26fc058 chore: update source for alpha 347.2
Skipped 1 file(s) >100MB (GitHub limit): source/__polyfill/04xxx/module_4823.js (118.4 MB)
2026-09-16 07:03:15 +00:00

57 lines
2 KiB
TypeScript

// Module ID: 13839
// Function ID: 13840
// Name: useHasXboxMonthlyOrbsPerk
// Dependencies: [1372, 1374, 4295, 1378, 1380, 504, 2]
// Exports: hasCrepeMonthlyOrbsPerk, useHasXboxMonthlyOrbsPerk
// Module 13839 (useHasXboxMonthlyOrbsPerk)
import initialize from "initialize" /* 504 */;
import PremiumUtils from "PremiumUtils" /* 4295 */;
import UserStore from "UserStore" /* 1372 */;
require = fn;
const PremiumTypes = fn(1374).PremiumTypes;
const size = fn(2);
const result = size.fileFinishedImporting("modules/rewards/hooks/useHasXboxMonthlyOrbsPerk.tsx");
export const hasCrepeMonthlyOrbsPerk = function hasCrepeMonthlyOrbsPerk(currentUser) {
if (obj.canUseMonthlyOrbs(currentUser)) {
if (!obj2.isPremiumExactly(currentUser, PremiumTypes.TIER_2)) {
let perks;
if (currentUser != null) {
perks = currentUser.perks;
}
const perkSource = tmp2(1378).getPerkSource(perks, tmp2(1380).Perk.MONTHLY_ORBS);
let hasItem = null != perkSource;
if (hasItem) {
hasItem = perkSource.includes(tmp2(1380).PerkSource.SOURCE_THIRDPARTY_CROISSANT);
}
return hasItem;
}
obj2 = PremiumUtils;
}
return false;
};
export const useHasXboxMonthlyOrbsPerk = function useHasXboxMonthlyOrbsPerk() {
const items = [UserStore];
const stateFromStores = initialize.useStateFromStores(items, () => currentUser.getCurrentUser());
let flag = false;
if (obj2.canUseMonthlyOrbs(stateFromStores)) {
flag = false;
if (!tmpResult.isPremiumExactly(stateFromStores, PremiumTypes.TIER_2)) {
let perks;
if (stateFromStores != null) {
perks = stateFromStores.perks;
}
const perkSource = tmp(1378).getPerkSource(perks, tmp(1380).Perk.MONTHLY_ORBS);
let hasItem = null != perkSource;
if (hasItem) {
hasItem = perkSource.includes(tmp(1380).PerkSource.SOURCE_THIRDPARTY_CROISSANT);
}
flag = hasItem;
const tmpResult2 = tmp(1378);
}
tmpResult = tmp(4295);
}
return flag;
};