decord/alpha/source/modules/lobbies/hooks/useChannelsAllowedToUnlink.tsx
github-actions 45f5884862 chore: update source for alpha 348.2
Skipped 1 file(s) >100MB (GitHub limit): source/__polyfill/05xxx/module_5012.js (118.4 MB)
2026-09-23 06:49:31 +00:00

55 lines
1.9 KiB
TypeScript

// Module ID: 18009
// Function ID: 18010
// Name: useChannelsAllowedToUnlink
// Dependencies: [4460, 4462, 11279, 504, 2]
// Exports: getChannelsAllowedToUnlink, useChannelsAllowedToUnlink
// Module 18009 (useChannelsAllowedToUnlink)
import GuildChannelStore from "GuildChannelStore" /* 4460 */;
import PermissionStore from "PermissionStore" /* 4462 */;
const require = globalThis.__r;
const require = fn;
let closure_3 = fn(4460).GUILD_SELECTABLE_CHANNELS_KEY;
const size = fn(2);
const result = size.fileFinishedImporting("modules/lobbies/hooks/useChannelsAllowedToUnlink.tsx");
export const getChannelsAllowedToUnlink = function getChannelsAllowedToUnlink(arg0) {
let obj = arg1;
if (arg1 === undefined) {
obj = GuildChannelStore;
}
let tmp = arg2;
if (arg2 === undefined) {
tmp = PermissionStore;
}
closure_0 = tmp;
if (null == arg0) {
let items = [];
} else {
const found = obj.getChannels(arg0)[closure_3].filter((channel) => closure_0(dependencyMap[2]).canUnlinkLobbyChannel(channel.channel, closure_0));
items = found.map((channel) => channel.channel);
const arr = obj.getChannels(arg0)[closure_3];
}
return items;
};
export const useChannelsAllowedToUnlink = function useChannelsAllowedToUnlink(id) {
_require = id;
let items = [PermissionStore, GuildChannelStore];
return require("initialize").useStateFromStoresArray(items, () => {
if (GuildChannelStore !== undefined) {
if (tmp2 !== undefined) {
closure_0 = tmp2;
if (null == tmp) {
let items = [];
} else {
const found = GuildChannelStore.getChannels(tmp)[closure_3].filter((channel) => closure_0(dependencyMap[2]).canUnlinkLobbyChannel(channel.channel, closure_0));
items = found.map((channel) => channel.channel);
const arr = GuildChannelStore.getChannels(tmp)[closure_3];
}
return items;
}
}
});
};