Files
discord-decomp/modules/lobbies/hooks/useChannelsAllowedToUnlink.tsx
T
2026-11-01 12:12:55 +02:00

36 lines
1.3 KiB
TypeScript

// Metro module 16358 (f16359).
import GuildChannelStore, { GUILD_SELECTABLE_CHANNELS_KEY } from "../../../stores/GuildChannelStore";
import PermissionStore from "../../../stores/PermissionStore";
import { useStateFromStoresArray } from "../../../_bundle/Module589";
function $mk99349($env) {
return (a0) => {
const r1 = $env.$parent;
return (0, r1[0])(r1[1][2]).canUnlinkLobbyChannel(a0.channel, $env[0]);
};
}
function $mk99350() {
return (a0) => a0.channel;
}
let env11772 = {};
export function getChannelsAllowedToUnlink(a0, r6 = GuildChannelStore, r4 = PermissionStore) {
let env23002;
const r2 = env23002 = {
$parent: env11772
};
env23002[0] = r4;
return a0 == null ? [] : r6.getChannels(a0)[GUILD_SELECTABLE_CHANNELS_KEY].filter($mk99349(r2)).map($mk99350());
}
export function useChannelsAllowedToUnlink(c23003_0) {
return useStateFromStoresArray([PermissionStore, GuildChannelStore], () => {
const r3 = env11772;
if (GuildChannelStore !== void 0 && PermissionStore !== void 0) {
let env28345;
const r7 = env28345 = {
$parent: r3
};
env28345[0] = PermissionStore;
return c23003_0 == null ? [] : GuildChannelStore.getChannels(c23003_0)[GUILD_SELECTABLE_CHANNELS_KEY].filter($mk99349(r7)).map($mk99350());
}
});
}