decord/source/modules/guild_role_subscriptions/useChannelRoleSubscriptionStatus.tsx

60 lines
1.9 KiB
TypeScript
Raw Normal View History

2026-07-21 22:01:30 +00:00
// Module ID: 4570
2026-07-22 07:54:56 +00:00
// Function ID: 40078
2026-07-20 16:05:17 +00:00
// Name: getChannelRoleSubscriptionStatus
2026-07-22 07:54:56 +00:00
// Dependencies: [3827, 44, 2, 27, 4589, 3769]
2026-07-20 16:05:17 +00:00
// Exports: default
2026-07-21 22:01:30 +00:00
// Module 4570 (getChannelRoleSubscriptionStatus)
2026-07-22 07:54:56 +00:00
import closure_2 from "t";
import invariant from "invariant";
import result2 from "result2";
import { Permissions } from "get ActivityIndicator";
import _createForOfIteratorHelperLoose from "_createForOfIteratorHelperLoose";
function getChannelRoleSubscriptionStatus(id, result2, invariant, closure_6) {
let obj = result2;
let obj2 = invariant;
2026-07-20 16:05:17 +00:00
let tmp = closure_6;
2026-07-22 07:54:56 +00:00
if (result2 === undefined) {
obj = invariant;
2026-07-20 16:05:17 +00:00
}
if (obj2 === undefined) {
obj2 = closure_2;
}
if (tmp === undefined) {
2026-07-22 07:54:56 +00:00
tmp = result2;
2026-07-20 16:05:17 +00:00
}
const channel = obj.getChannel(id);
if (null != channel) {
if (channel.isRoleSubscriptionTemplatePreviewChannel()) {
2026-07-22 07:54:56 +00:00
obj = { USE_EXIF: null, USE_IPTC: null };
2026-07-20 16:05:17 +00:00
}
return obj;
}
if (null != channel) {
if (obj2.isChannelGated(channel.guild_id, channel.id)) {
obj = { isSubscriptionGated: true };
const can = tmp.can;
let canResult = Permissions;
if (channel.isGuildVocal()) {
canResult = can(canResult.CONNECT, channel);
let tmp3 = !canResult;
} else {
tmp3 = !can(canResult.VIEW_CHANNEL, channel);
}
obj.needSubscriptionToAccess = tmp3;
}
}
obj = closure_6;
}
2026-07-22 07:54:56 +00:00
let closure_6 = { 0: true, 0: true };
const result = _createForOfIteratorHelperLoose.fileFinishedImporting("modules/guild_role_subscriptions/useChannelRoleSubscriptionStatus.tsx");
2026-07-20 16:05:17 +00:00
export default function useChannelRoleSubscriptionStatus(arg0) {
const arg1 = arg0;
2026-07-22 07:54:56 +00:00
const items = [invariant, closure_2, result2];
2026-07-20 16:05:17 +00:00
const items1 = [arg0];
2026-07-22 07:54:56 +00:00
return arg1(dependencyMap[4]).useStateFromStoresObject(items, () => callback(arg0, invariant, closure_2, result2), items1);
2026-07-20 16:05:17 +00:00
};
export { getChannelRoleSubscriptionStatus };