decord/alpha/source/modules/permissions/useFirstGloballyViewbleGuildChannelId.tsx

100 lines
3 KiB
TypeScript
Raw Normal View History

2026-10-08 09:57:35 +00:00
// Module ID: 16286
// Function ID: 16287
2026-07-29 08:29:29 +00:00
// Name: useFirstGloballyViewbleGuildChannelId
2026-10-08 09:57:35 +00:00
// Dependencies: [4705, 1096, 558, 576, 4712, 504, 2]
2026-07-20 16:05:17 +00:00
2026-10-08 09:57:35 +00:00
// Module 16286 (useFirstGloballyViewbleGuildChannelId)
2026-10-03 08:58:59 +00:00
import Constants from "Constants" /* 1096 */;
2026-10-08 09:57:35 +00:00
import PermissionUtilsAll from "PermissionUtils" /* 4712 */;
import GuildChannelStore from "GuildChannelStore" /* 4705 */;
2026-10-03 08:58:59 +00:00
import ReactCompilerGating from "ReactCompilerGating" /* 558 */;
import size from "module_2" /* 2 */;
2026-07-23 10:11:24 +00:00
const require = globalThis.__r;
2026-10-03 08:58:59 +00:00
let _require;
2026-10-03 08:58:59 +00:00
const Permissions = Constants.Permissions;
2026-10-08 09:57:35 +00:00
const tmp2 = ReactCompilerGating.isReactCompilerEnabled() ? (function useFirstGloballyViewbleGuildChannelId(arg0) {
2026-10-03 08:58:59 +00:00
let closure_0;
let first;
let tmp6;
let tmp7;
_require = arg0;
const tmp = _require;
const obj = require("react");
const cResult = obj.c(4);
if (cResult[0] === Symbol.for("react.memo_cache_sentinel")) {
const items = [GuildChannelStore];
cResult[0] = items;
first = items;
} else {
first = cResult[0];
}
if (cResult[1] !== arg0) {
2026-10-08 09:57:35 +00:00
const fn = function o() {
2026-10-03 08:58:59 +00:00
if (null != closure_0) {
const selectableChannels = GuildChannelStore.getSelectableChannels(tmp);
for (const item10010 of selectableChannels) {
let channel = item10010.channel;
let obj2 = PermissionUtilsAll;
if (obj2.canEveryone(Permissions.VIEW_CHANNEL, channel)) {
let id = channel.id;
obj.return();
return id;
}
}
let id1;
if (selectableChannels != null) {
const first = selectableChannels[0];
if (first != null) {
id1 = first.channel.id;
}
}
return id1;
}
};
const items1 = [arg0];
cResult[1] = arg0;
cResult[2] = fn;
cResult[3] = items1;
tmp7 = items1;
tmp6 = fn;
} else {
tmp6 = cResult[2];
tmp7 = cResult[3];
}
const tmpResult = tmp(504);
return tmpResult.useStateFromStores(first, tmp6, tmp7);
2026-10-08 09:57:35 +00:00
}) : (function useFirstGloballyViewbleGuildChannelId(arg0) {
2026-10-03 08:58:59 +00:00
let closure_0;
_require = arg0;
const obj = require("get initialized");
const items = [GuildChannelStore];
2026-10-03 08:58:59 +00:00
const items1 = [arg0];
return obj.useStateFromStores(items, () => {
2026-07-23 10:11:24 +00:00
if (null != closure_0) {
const selectableChannels = GuildChannelStore.getSelectableChannels(tmp);
2026-07-29 08:29:29 +00:00
for (const item10010 of selectableChannels) {
let channel = item10010.channel;
let obj2 = PermissionUtilsAll;
if (obj2.canEveryone(Permissions.VIEW_CHANNEL, channel)) {
2026-10-03 08:58:59 +00:00
let id = channel.id;
2026-07-29 08:29:29 +00:00
obj.return();
2026-10-03 08:58:59 +00:00
return id;
2026-07-20 16:05:17 +00:00
}
}
2026-10-03 08:58:59 +00:00
let id1;
2026-07-29 08:29:29 +00:00
if (selectableChannels != null) {
2026-07-20 16:05:17 +00:00
const first = selectableChannels[0];
2026-07-29 08:29:29 +00:00
if (first != null) {
2026-10-03 08:58:59 +00:00
id1 = first.channel.id;
2026-07-20 16:05:17 +00:00
}
}
2026-10-03 08:58:59 +00:00
return id1;
2026-07-20 16:05:17 +00:00
}
}, items1);
2026-10-03 08:58:59 +00:00
});
const result = size.fileFinishedImporting("modules/permissions/useFirstGloballyViewbleGuildChannelId.tsx");
export const useFirstGloballyViewbleGuildChannelId = tmp2;