decord/stable/source/modules/lobbies/LobbyUtils.tsx
github-actions 528a3dd5ba chore: update source for stable 345.9
Skipped 1 file(s) >100MB (GitHub limit): source/__polyfill/04xxx/module_4745.js (118.4 MB)
2026-09-18 20:18:48 +00:00

60 lines
1.7 KiB
TypeScript

// Module ID: 10938
// Function ID: 10939
// Name: LobbyUtils
// Dependencies: [4199, 1074, 504, 2]
// Exports: canUnlinkLobbyChannel, useCanUnlinkLobbyChannel
// Module 10938 (LobbyUtils)
import PermissionStore from "PermissionStore" /* 4199 */;
const require = globalThis.__r;
const require = fn;
const Permissions = fn(1074).Permissions;
const size = fn(2);
const result = size.fileFinishedImporting("modules/lobbies/LobbyUtils.tsx");
export const canUnlinkLobbyChannel = function canUnlinkLobbyChannel(channel, arg1) {
let obj = arg1;
if (arg1 === undefined) {
obj = PermissionStore;
}
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) {
_require = channel;
const items = [PermissionStore];
return require("initialize").useStateFromStores(items, () => {
if (PermissionStore !== undefined) {
let tmp3 = null != tmp;
if (tmp3) {
let canResult = null != tmp.linkedLobby;
if (canResult) {
canResult = obj.can(Permissions.MANAGE_CHANNELS, tmp);
}
if (canResult) {
canResult = obj.can(Permissions.VIEW_CHANNEL, tmp);
}
if (canResult) {
canResult = obj.can(Permissions.SEND_MESSAGES, tmp);
}
tmp3 = canResult;
}
return tmp3;
}
});
};