decord/source/modules/spoiler_channels/SpoilerChannelUtils.tsx

113 lines
3.4 KiB
TypeScript
Raw Normal View History

2026-07-29 08:29:29 +00:00
// Module ID: 7727
// Function ID: 7728
// Name: isChannelSpoilerGated
// Dependencies: [1372, 7728, 589, 2]
2026-07-20 16:05:17 +00:00
// Exports: shouldShowSpoilerGateForChannelId, useGetSpoilerGatingChannelId, useIsChannelSpoilerGated, useShouldShowSpoilerGateForChannelId
2026-07-29 08:29:29 +00:00
// Module 7727 (isChannelSpoilerGated)
import ensureGuildLoaded from "ensureGuildLoaded";
import initialize from "initialize";
2026-07-23 10:11:24 +00:00
const require = arg1;
2026-07-29 08:29:29 +00:00
function isChannelSpoilerGated(channel) {
2026-07-20 16:05:17 +00:00
let obj = arg1;
if (arg1 === undefined) {
2026-07-29 08:29:29 +00:00
obj = initialize;
}
let obj2 = arg2;
if (arg2 === undefined) {
obj2 = ensureGuildLoaded;
}
if (obj === undefined) {
obj = initialize;
2026-07-20 16:05:17 +00:00
}
if (obj2 === undefined) {
2026-07-29 08:29:29 +00:00
obj2 = ensureGuildLoaded;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
let id1 = null;
if (null != channel) {
if (channel.isSpoilerChannel()) {
let id = null;
if (!obj.didAgree(channel.id)) {
id = channel.id;
}
id1 = id;
} else {
id1 = null;
if (null != channel.parent_id) {
channel = obj2.getChannel(channel.parent_id);
id1 = null;
if (null != channel) {
id1 = null;
if (channel.isSpoilerChannel()) {
id1 = null;
if (!obj.didAgree(channel.id)) {
id1 = channel.id;
}
2026-07-20 16:05:17 +00:00
}
}
}
}
}
2026-07-29 08:29:29 +00:00
return null != id1;
2026-07-20 16:05:17 +00:00
}
2026-07-23 10:11:24 +00:00
const result = require("initialize").fileFinishedImporting("modules/spoiler_channels/SpoilerChannelUtils.tsx");
2026-07-20 16:05:17 +00:00
2026-07-29 08:29:29 +00:00
export const useGetSpoilerGatingChannelId = function useGetSpoilerGatingChannelId(stateFromStores) {
const _require = stateFromStores;
const items = [initialize, ensureGuildLoaded];
const items1 = [stateFromStores];
return _require(589).useStateFromStores(items, () => {
if (outer1_3 !== undefined) {
if (obj3 !== undefined) {
let id1 = null;
if (null != obj) {
if (obj.isSpoilerChannel()) {
let id = null;
if (!obj2.didAgree(obj.id)) {
id = obj.id;
}
id1 = id;
} else {
id1 = null;
if (null != obj.parent_id) {
const channel = obj3.getChannel(obj.parent_id);
id1 = null;
if (null != channel) {
id1 = null;
if (channel.isSpoilerChannel()) {
id1 = null;
if (!obj2.didAgree(channel.id)) {
id1 = channel.id;
}
}
}
}
}
}
return id1;
}
}
}, items1);
2026-07-20 16:05:17 +00:00
};
export { isChannelSpoilerGated };
export const useIsChannelSpoilerGated = function useIsChannelSpoilerGated(stateFromStores) {
2026-07-23 10:11:24 +00:00
const _require = stateFromStores;
2026-07-29 08:29:29 +00:00
const items = [initialize, ensureGuildLoaded];
2026-07-20 16:05:17 +00:00
const items1 = [stateFromStores];
2026-07-29 08:29:29 +00:00
return _require(589).useStateFromStores(items, () => outer1_4(closure_0, outer1_3, outer1_2), items1);
2026-07-20 16:05:17 +00:00
};
export const useShouldShowSpoilerGateForChannelId = function useShouldShowSpoilerGateForChannelId(arg0) {
2026-07-23 10:11:24 +00:00
const _require = arg0;
2026-07-29 08:29:29 +00:00
const items = [ensureGuildLoaded, initialize];
2026-07-20 16:05:17 +00:00
const items1 = [arg0];
2026-07-29 08:29:29 +00:00
return _require(589).useStateFromStores(items, () => outer1_4(outer1_2.getChannel(closure_0), outer1_3, outer1_2), items1);
2026-07-20 16:05:17 +00:00
};
export const shouldShowSpoilerGateForChannelId = function shouldShowSpoilerGateForChannelId(channelId) {
let tmp = null != channelId;
if (tmp) {
tmp = isChannelSpoilerGated(channel.getChannel(channelId));
}
return tmp;
};