decord/source/modules/guild_role_subscriptions/useActiveGuildSubscriptions.tsx

70 lines
2.1 KiB
TypeScript
Raw Normal View History

2026-08-28 06:19:39 +00:00
// Module ID: 14740
// Function ID: 14741
2026-07-20 16:05:17 +00:00
// Name: useActiveGuildSubscriptions
2026-08-28 06:19:39 +00:00
// Dependencies: [19, 4114, 14734, 14735, 589, 4803, 2]
2026-07-20 16:05:17 +00:00
// Exports: default
2026-08-28 06:19:39 +00:00
// Module 14740 (useActiveGuildSubscriptions)
import useUserRoleSubscriptionRelationshipDefault from "useUserRoleSubscriptionRelationship" /* 14735 */;
2026-08-24 06:08:38 +00:00
import closure_4 from "noop" /* 19 */;
2026-08-28 06:19:39 +00:00
import closure_5 from "reset" /* 4114 */;
import { UserGuildRoleSubscriptionRelationship as closure_6 } from "MAX_SUBSCRIPTION_TIERS" /* 14734 */;
2026-07-23 10:11:24 +00:00
const require = arg1;
2026-07-20 16:05:17 +00:00
let closure_7 = [];
2026-08-24 06:08:38 +00:00
const result = require("set").fileFinishedImporting("modules/guild_role_subscriptions/useActiveGuildSubscriptions.tsx");
2026-07-20 16:05:17 +00:00
export default function useActiveGuildSubscriptions() {
let obj = arg0;
if (arg0 === undefined) {
obj = {};
}
let flag = obj.ensureFresh;
if (flag === undefined) {
flag = false;
}
2026-08-24 06:08:38 +00:00
importDefault = undefined;
closure_2 = undefined;
const tmp = useUserRoleSubscriptionRelationshipDefault() === constants.SUBSCRIBED;
2026-07-20 16:05:17 +00:00
importDefault = tmp;
2026-08-24 06:08:38 +00:00
const items = [closure_5];
2026-07-29 08:29:29 +00:00
let stateFromStores = flag(589).useStateFromStores(items, () => activeGuildSubscriptions.getActiveGuildSubscriptions());
2026-07-20 16:05:17 +00:00
closure_2 = React.useRef(false);
const items1 = [flag, tmp];
const effect = React.useEffect(() => {
2026-07-29 08:29:29 +00:00
const current = ref.current;
2026-08-24 06:08:38 +00:00
const activeGuildSubscriptions = closure_1_5.getActiveGuildSubscriptions();
2026-07-29 08:29:29 +00:00
let num;
if (activeGuildSubscriptions != null) {
num = activeGuildSubscriptions.length;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
if (num == null) {
num = 0;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
let tmp5 = !tmp4;
2026-08-24 06:08:38 +00:00
if (0 !== num || !closure_1) {
2026-07-29 08:29:29 +00:00
let tmp6 = !tmp;
if (tmp) {
tmp6 = current;
}
tmp5 = !tmp6;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
if (!tmp5) {
let tmp7 = !current;
if (!current) {
2026-08-24 06:08:38 +00:00
tmp7 = !closure_1_5.hasFetchedSubscriptions();
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
tmp5 = tmp7;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
if (tmp5) {
2026-07-20 16:05:17 +00:00
ref.current = true;
2026-08-24 06:08:38 +00:00
const subscriptions = ref(closure_1_3[5]).fetchSubscriptions();
const obj2 = ref(closure_1_3[5]);
2026-07-20 16:05:17 +00:00
}
}, items1);
2026-07-29 08:29:29 +00:00
if (stateFromStores == null) {
2026-07-20 16:05:17 +00:00
stateFromStores = closure_7;
}
return stateFromStores;
};