decord/source/modules/media_channel/useShouldHideMediaOptions.tsx

42 lines
1.2 KiB
TypeScript
Raw Normal View History

2026-08-24 06:08:38 +00:00
// Module ID: 10891
// Function ID: 10892
2026-07-20 16:05:17 +00:00
// Name: useShouldHideMediaOptions
2026-08-11 06:20:06 +00:00
// Dependencies: [1391, 1398, 647, 2]
2026-07-20 16:05:17 +00:00
// Exports: default
2026-08-24 06:08:38 +00:00
// Module 10891 (useShouldHideMediaOptions)
import closure_2 from "ensureGuildLoaded" /* 1391 */;
import { ChannelFlags } from "set" /* 1398 */;
2026-07-23 10:11:24 +00:00
const require = arg1;
2026-08-24 06:08:38 +00:00
const result = require("set").fileFinishedImporting("modules/media_channel/useShouldHideMediaOptions.tsx");
2026-07-20 16:05:17 +00:00
export default function useShouldHideMediaOptions(arg0) {
2026-07-23 10:11:24 +00:00
const _require = arg0;
2026-08-24 06:08:38 +00:00
const items = [closure_2];
2026-07-29 08:29:29 +00:00
const stateFromStores = _require(647).useStateFromStores(items, () => {
2026-08-24 06:08:38 +00:00
const channel = closure_1_2.getChannel(closure_0);
2026-07-20 16:05:17 +00:00
let parent_id;
2026-07-29 08:29:29 +00:00
if (channel != null) {
2026-07-20 16:05:17 +00:00
parent_id = channel.parent_id;
}
let channel1 = null;
if (null != parent_id) {
channel1 = null;
if (channel.isForumPost()) {
let parent_id1;
2026-07-29 08:29:29 +00:00
if (channel != null) {
2026-07-20 16:05:17 +00:00
parent_id1 = channel.parent_id;
}
2026-08-24 06:08:38 +00:00
channel1 = closure_1_2.getChannel(parent_id1);
2026-07-20 16:05:17 +00:00
}
}
return channel1;
});
2026-07-29 08:29:29 +00:00
let hasFlagResult;
if (stateFromStores != null) {
2026-07-20 16:05:17 +00:00
hasFlagResult = stateFromStores.hasFlag(ChannelFlags.HIDE_MEDIA_DOWNLOAD_OPTIONS);
}
return true === hasFlagResult;
};