decord/stable/source/modules/lobbies/LobbyUtils.tsx
github-actions e2bc0408ee chore: update source for stable 346.13
Skipped 1 file(s) >100MB (GitHub limit): source/__polyfill/04xxx/module_4821.js (118.4 MB)
2026-09-22 22:11:40 +00:00

60 lines
1.7 KiB
TypeScript

// Module ID: 11068
// Function ID: 11069
// Name: LobbyUtils
// Dependencies: [4275, 1074, 504, 2]
// Exports: canUnlinkLobbyChannel, useCanUnlinkLobbyChannel
// Module 11068 (LobbyUtils)
import PermissionStore from "PermissionStore" /* 4275 */;
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;
}
});
};