decord/source/modules/lobbies/LobbyUtils.tsx
github-actions cd74c1f217 chore: update source for alpha 345.5
Skipped 1 file(s) >100MB (GitHub limit): source/__vendor/09xxx/9667_m.js (378 MB)
2026-09-05 10:56:28 +00:00

57 lines
1.7 KiB
TypeScript

// Module ID: 10933
// Function ID: 10934
// Name: canUnlinkLobbyChannel
// Dependencies: [4199, 1074, 504, 2]
// Exports: canUnlinkLobbyChannel, useCanUnlinkLobbyChannel
// Module 10933 (canUnlinkLobbyChannel)
import closure_2 from "getUncachedChannelPermissions" /* 4199 */;
import { Permissions } from "ME" /* 1074 */;
const require = arg1;
const result = require("set").fileFinishedImporting("modules/lobbies/LobbyUtils.tsx");
export const canUnlinkLobbyChannel = function canUnlinkLobbyChannel(channel, closure_0) {
let obj = closure_0;
if (closure_0 === undefined) {
obj = closure_2;
}
let tmp = null != channel;
if (tmp) {
let canResult = null != channel.linkedLobby;
if (canResult) {
canResult = obj.can(Permissions.MANAGE_CHANNELS, channel);
}
if (canResult) {
canResult = obj.can(Permissions.VIEW_CHANNEL, channel);
}
if (canResult) {
canResult = obj.can(Permissions.SEND_MESSAGES, channel);
}
tmp = canResult;
}
return tmp;
};
export const useCanUnlinkLobbyChannel = function useCanUnlinkLobbyChannel(channel) {
const _require = channel;
const items = [closure_2];
return _require(504).useStateFromStores(items, () => {
if (closure_1_2 !== undefined) {
let tmp3 = null != tmp;
if (tmp3) {
let canResult = null != tmp.linkedLobby;
if (canResult) {
canResult = obj.can(closure_1_3.MANAGE_CHANNELS, tmp);
}
if (canResult) {
canResult = obj.can(closure_1_3.VIEW_CHANNEL, tmp);
}
if (canResult) {
canResult = obj.can(closure_1_3.SEND_MESSAGES, tmp);
}
tmp3 = canResult;
}
return tmp3;
}
});
};