57 lines
2 KiB
TypeScript
57 lines
2 KiB
TypeScript
// Module ID: 13735
|
|
// Function ID: 13736
|
|
// Name: hasCrepeMonthlyOrbsPerk
|
|
// Dependencies: [1371, 1373, 4218, 1377, 1379, 504, 2]
|
|
// Exports: hasCrepeMonthlyOrbsPerk, useHasXboxMonthlyOrbsPerk
|
|
|
|
// Module 13735 (hasCrepeMonthlyOrbsPerk)
|
|
import initialize from "initialize" /* 504 */;
|
|
import getPremiumPlanItem from "getPremiumPlanItem" /* 4218 */;
|
|
import closure_3 from "mergeGuildAvatar" /* 1371 */;
|
|
import { PremiumTypes } from "GuildFeatures" /* 1373 */;
|
|
|
|
require = arg1;
|
|
const result = require("set").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(1377).getPerkSource(perks, tmp2(1379).Perk.MONTHLY_ORBS);
|
|
let hasItem = null != perkSource;
|
|
if (hasItem) {
|
|
hasItem = perkSource.includes(tmp2(1379).PerkSource.SOURCE_THIRDPARTY_CROISSANT);
|
|
}
|
|
return hasItem;
|
|
}
|
|
obj2 = getPremiumPlanItem;
|
|
}
|
|
return false;
|
|
};
|
|
export const useHasXboxMonthlyOrbsPerk = function useHasXboxMonthlyOrbsPerk() {
|
|
const items = [closure_3];
|
|
const stateFromStores = initialize.useStateFromStores(items, () => currentUser.getCurrentUser());
|
|
const obj = initialize;
|
|
let flag = false;
|
|
if (obj2.canUseMonthlyOrbs(stateFromStores)) {
|
|
let tmpResult = tmp(4218);
|
|
flag = false;
|
|
if (!tmpResult.isPremiumExactly(stateFromStores, PremiumTypes.TIER_2)) {
|
|
tmpResult = tmp(1377);
|
|
let perks;
|
|
if (stateFromStores != null) {
|
|
perks = stateFromStores.perks;
|
|
}
|
|
const perkSource = tmpResult.getPerkSource(perks, tmp(1379).Perk.MONTHLY_ORBS);
|
|
let hasItem = null != perkSource;
|
|
if (hasItem) {
|
|
hasItem = perkSource.includes(tmp(1379).PerkSource.SOURCE_THIRDPARTY_CROISSANT);
|
|
}
|
|
flag = hasItem;
|
|
}
|
|
}
|
|
return flag;
|
|
};
|