57 lines
2 KiB
TypeScript
57 lines
2 KiB
TypeScript
// Module ID: 13337
|
|
// Function ID: 13338
|
|
// Name: hasCrepeMonthlyOrbsPerk
|
|
// Dependencies: [1922, 1924, 4042, 1938, 1940, 589, 2]
|
|
// Exports: hasCrepeMonthlyOrbsPerk, useHasXboxMonthlyOrbsPerk
|
|
|
|
// Module 13337 (hasCrepeMonthlyOrbsPerk)
|
|
import initialize from "initialize" /* 589 */;
|
|
import getPremiumPlanItem from "getPremiumPlanItem" /* 4042 */;
|
|
import closure_3 from "mergeGuildAvatar" /* 1922 */;
|
|
import { PremiumTypes } from "GuildFeatures" /* 1924 */;
|
|
|
|
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(1938).getPerkSource(perks, tmp2(1940).Perk.MONTHLY_ORBS);
|
|
let hasItem = null != perkSource;
|
|
if (hasItem) {
|
|
hasItem = perkSource.includes(tmp2(1940).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(4042);
|
|
flag = false;
|
|
if (!tmpResult.isPremiumExactly(stateFromStores, PremiumTypes.TIER_2)) {
|
|
tmpResult = tmp(1938);
|
|
let perks;
|
|
if (stateFromStores != null) {
|
|
perks = stateFromStores.perks;
|
|
}
|
|
const perkSource = tmpResult.getPerkSource(perks, tmp(1940).Perk.MONTHLY_ORBS);
|
|
let hasItem = null != perkSource;
|
|
if (hasItem) {
|
|
hasItem = perkSource.includes(tmp(1940).PerkSource.SOURCE_THIRDPARTY_CROISSANT);
|
|
}
|
|
flag = hasItem;
|
|
}
|
|
}
|
|
return flag;
|
|
};
|