Skipped 1 file(s) >100MB (GitHub limit): source/__polyfill/04xxx/module_4824.js (118.4 MB)
68 lines
2.1 KiB
TypeScript
68 lines
2.1 KiB
TypeScript
// Module ID: 15305
|
|
// Function ID: 15306
|
|
// Name: useActiveGuildSubscriptions
|
|
// Dependencies: [19, 4303, 15299, 15300, 504, 4963, 2]
|
|
// Exports: default
|
|
|
|
// Module 15305 (useActiveGuildSubscriptions)
|
|
import actions_BillingActionCreatorsAll from "actions/BillingActionCreators" /* 4963 */;
|
|
import useUserRoleSubscriptionRelationshipDefault from "useUserRoleSubscriptionRelationship" /* 15300 */;
|
|
import noop from "module_19" /* 19 */;
|
|
import SubscriptionStore from "SubscriptionStore" /* 4303 */;
|
|
|
|
const require = fn;
|
|
const constants = fn(15299).UserGuildRoleSubscriptionRelationship;
|
|
let closure_7 = [];
|
|
const size = fn(2);
|
|
const result = size.fileFinishedImporting("modules/guild_role_subscriptions/useActiveGuildSubscriptions.tsx");
|
|
|
|
export default function useActiveGuildSubscriptions() {
|
|
let obj = arg0;
|
|
if (arg0 === undefined) {
|
|
obj = {};
|
|
}
|
|
let flag = obj.ensureFresh;
|
|
if (flag === undefined) {
|
|
flag = false;
|
|
}
|
|
const tmp = useUserRoleSubscriptionRelationshipDefault() === constants.SUBSCRIBED;
|
|
importDefault = tmp;
|
|
const items = [SubscriptionStore];
|
|
let stateFromStores = flag(504).useStateFromStores(items, () => activeGuildSubscriptions.getActiveGuildSubscriptions());
|
|
noop.useRef(false);
|
|
const items1 = [flag, tmp];
|
|
const effect = noop.useEffect(() => {
|
|
const current = ref.current;
|
|
activeGuildSubscriptions = SubscriptionStore.getActiveGuildSubscriptions();
|
|
let num;
|
|
if (activeGuildSubscriptions != null) {
|
|
num = activeGuildSubscriptions.length;
|
|
}
|
|
if (num == null) {
|
|
num = 0;
|
|
}
|
|
let tmp5 = !tmp4;
|
|
if (0 !== num || !closure_1) {
|
|
let tmp6 = !tmp;
|
|
if (tmp) {
|
|
tmp6 = current;
|
|
}
|
|
tmp5 = !tmp6;
|
|
}
|
|
if (!tmp5) {
|
|
let tmp7 = !current;
|
|
if (!current) {
|
|
tmp7 = !SubscriptionStore.hasFetchedSubscriptions();
|
|
}
|
|
tmp5 = tmp7;
|
|
}
|
|
if (tmp5) {
|
|
ref.current = true;
|
|
const subscriptions = actions_BillingActionCreatorsAll.fetchSubscriptions();
|
|
}
|
|
}, items1);
|
|
if (stateFromStores == null) {
|
|
stateFromStores = closure_7;
|
|
}
|
|
return stateFromStores;
|
|
};
|