decord/source/modules/lobbies/LobbyUtils.tsx

58 lines
1.7 KiB
TypeScript
Raw Normal View History

2026-08-15 05:55:55 +00:00
// Module ID: 9949
// Function ID: 9950
2026-07-20 16:05:17 +00:00
// Name: canUnlinkLobbyChannel
2026-08-15 05:55:55 +00:00
// Dependencies: [4021, 676, 589, 2]
2026-07-29 08:29:29 +00:00
// Exports: canUnlinkLobbyChannel, useCanUnlinkLobbyChannel
2026-07-20 16:05:17 +00:00
2026-08-15 05:55:55 +00:00
// Module 9949 (canUnlinkLobbyChannel)
2026-07-29 08:29:29 +00:00
import getUncachedChannelPermissions from "getUncachedChannelPermissions";
2026-07-23 10:11:24 +00:00
import { Permissions } from "ME";
const require = arg1;
2026-07-29 08:29:29 +00:00
const result = require("initialize").fileFinishedImporting("modules/lobbies/LobbyUtils.tsx");
export const canUnlinkLobbyChannel = function canUnlinkLobbyChannel(channel, closure_0) {
2026-07-23 10:11:24 +00:00
let obj = closure_0;
if (closure_0 === undefined) {
2026-07-29 08:29:29 +00:00
obj = getUncachedChannelPermissions;
2026-07-20 16:05:17 +00:00
}
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;
2026-07-29 08:29:29 +00:00
};
2026-07-20 16:05:17 +00:00
export const useCanUnlinkLobbyChannel = function useCanUnlinkLobbyChannel(channel) {
2026-07-23 10:11:24 +00:00
const _require = channel;
2026-07-29 08:29:29 +00:00
const items = [getUncachedChannelPermissions];
return _require(589).useStateFromStores(items, () => {
if (outer1_2 !== undefined) {
let tmp3 = null != tmp;
if (tmp3) {
let canResult = null != tmp.linkedLobby;
if (canResult) {
canResult = obj.can(outer1_3.MANAGE_CHANNELS, tmp);
}
if (canResult) {
canResult = obj.can(outer1_3.VIEW_CHANNEL, tmp);
}
if (canResult) {
canResult = obj.can(outer1_3.SEND_MESSAGES, tmp);
}
tmp3 = canResult;
}
return tmp3;
}
});
2026-07-20 16:05:17 +00:00
};