decord/source/modules/lobbies/hooks/useChannelsAllowedToUnlink.tsx

56 lines
1.9 KiB
TypeScript
Raw Normal View History

// Module ID: 17733
// Function ID: 17734
// Name: useChannelsAllowedToUnlink
// Dependencies: [2013, 4276, 11082, 504, 2]
2026-07-29 08:29:29 +00:00
// Exports: getChannelsAllowedToUnlink, useChannelsAllowedToUnlink
2026-07-20 16:05:17 +00:00
// Module 17733 (useChannelsAllowedToUnlink)
import GuildChannelStore from "GuildChannelStore" /* 2013 */;
import PermissionStore from "PermissionStore" /* 4276 */;
2026-07-23 10:11:24 +00:00
const require = globalThis.__r;
const require = fn;
let closure_3 = fn(2013).GUILD_SELECTABLE_CHANNELS_KEY;
const size = fn(2);
const result = size.fileFinishedImporting("modules/lobbies/hooks/useChannelsAllowedToUnlink.tsx");
2026-07-29 08:29:29 +00:00
export const getChannelsAllowedToUnlink = function getChannelsAllowedToUnlink(arg0) {
2026-07-20 16:05:17 +00:00
let obj = arg1;
if (arg1 === undefined) {
obj = GuildChannelStore;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
let tmp = arg2;
if (arg2 === undefined) {
tmp = PermissionStore;
2026-07-20 16:05:17 +00:00
}
2026-08-24 06:08:38 +00:00
closure_0 = tmp;
2026-07-20 16:05:17 +00:00
if (null == arg0) {
let items = [];
} else {
const found = obj.getChannels(arg0)[closure_3].filter((channel) => closure_0(dependencyMap[2]).canUnlinkLobbyChannel(channel.channel, closure_0));
2026-07-20 16:05:17 +00:00
items = found.map((channel) => channel.channel);
const arr = obj.getChannels(arg0)[closure_3];
}
return items;
2026-07-29 08:29:29 +00:00
};
2026-07-20 16:05:17 +00:00
export const useChannelsAllowedToUnlink = function useChannelsAllowedToUnlink(id) {
_require = id;
let items = [PermissionStore, GuildChannelStore];
return require("initialize").useStateFromStoresArray(items, () => {
if (GuildChannelStore !== undefined) {
2026-07-29 08:29:29 +00:00
if (tmp2 !== undefined) {
2026-08-24 06:08:38 +00:00
closure_0 = tmp2;
2026-07-29 08:29:29 +00:00
if (null == tmp) {
let items = [];
} else {
const found = GuildChannelStore.getChannels(tmp)[closure_3].filter((channel) => closure_0(dependencyMap[2]).canUnlinkLobbyChannel(channel.channel, closure_0));
2026-07-29 08:29:29 +00:00
items = found.map((channel) => channel.channel);
const arr = GuildChannelStore.getChannels(tmp)[closure_3];
2026-07-29 08:29:29 +00:00
}
return items;
}
}
});
2026-07-20 16:05:17 +00:00
};