decord/source/modules/spoiler_channels/SpoilerChannelUtils.tsx

113 lines
3.4 KiB
TypeScript
Raw Normal View History

2026-08-24 06:08:38 +00:00
// Module ID: 5272
// Function ID: 5273
2026-07-29 08:29:29 +00:00
// Name: isChannelSpoilerGated
2026-08-24 06:08:38 +00:00
// Dependencies: [1391, 5273, 589, 2]
2026-07-20 16:05:17 +00:00
// Exports: shouldShowSpoilerGateForChannelId, useGetSpoilerGatingChannelId, useIsChannelSpoilerGated, useShouldShowSpoilerGateForChannelId
2026-08-24 06:08:38 +00:00
// Module 5272 (isChannelSpoilerGated)
import closure_2 from "ensureGuildLoaded" /* 1391 */;
import closure_3 from "initialize" /* 5273 */;
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-08-24 06:08:38 +00:00
obj = closure_3;
2026-07-29 08:29:29 +00:00
}
let obj2 = arg2;
if (arg2 === undefined) {
2026-08-24 06:08:38 +00:00
obj2 = closure_2;
2026-07-29 08:29:29 +00:00
}
if (obj === undefined) {
2026-08-24 06:08:38 +00:00
obj = closure_3;
2026-07-20 16:05:17 +00:00
}
if (obj2 === undefined) {
2026-08-24 06:08:38 +00:00
obj2 = closure_2;
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-08-24 06:08:38 +00:00
const result = require("set").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;
2026-08-24 06:08:38 +00:00
const items = [closure_3, closure_2];
2026-07-29 08:29:29 +00:00
const items1 = [stateFromStores];
return _require(589).useStateFromStores(items, () => {
2026-08-24 06:08:38 +00:00
if (closure_1_3 !== undefined) {
2026-07-29 08:29:29 +00:00
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 };
2026-08-15 05:55:55 +00:00
export const useIsChannelSpoilerGated = function useIsChannelSpoilerGated(channel) {
const _require = channel;
2026-08-24 06:08:38 +00:00
const items = [closure_3, closure_2];
2026-08-15 05:55:55 +00:00
const items1 = [channel];
2026-08-24 06:08:38 +00:00
return _require(589).useStateFromStores(items, () => closure_1_4(closure_0, closure_1_3, closure_1_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-08-24 06:08:38 +00:00
const items = [closure_2, closure_3];
2026-07-20 16:05:17 +00:00
const items1 = [arg0];
2026-08-24 06:08:38 +00:00
return _require(589).useStateFromStores(items, () => closure_1_4(closure_1_2.getChannel(closure_0), closure_1_3, closure_1_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;
};