88 lines
2.6 KiB
TypeScript
88 lines
2.6 KiB
TypeScript
// Module ID: 9626
|
|
// Function ID: 9627
|
|
// Name: useHasVideoPermission
|
|
// Dependencies: [2074, 4509, 558, 576, 7210, 504, 2]
|
|
// Exports: getVideoPermission
|
|
|
|
// Module 9626 (useHasVideoPermission)
|
|
import StreamPermissionUtils from "StreamPermissionUtils" /* 7210 */;
|
|
import GuildStore from "GuildStore" /* 2074 */;
|
|
import PermissionStore from "PermissionStore" /* 4509 */;
|
|
import ReactCompilerGating from "ReactCompilerGating" /* 558 */;
|
|
import size from "module_2" /* 2 */;
|
|
|
|
const require = globalThis.__r;
|
|
let _require;
|
|
|
|
const tmp2 = ReactCompilerGating.isReactCompilerEnabled() ? ((arg0) => {
|
|
let closure_0;
|
|
let first;
|
|
let tmp7;
|
|
let tmp8;
|
|
_require = arg0;
|
|
let tmp = _require;
|
|
const obj = require("react");
|
|
const cResult = obj.c(4);
|
|
if (cResult[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
const items = [GuildStore, ];
|
|
items[1] = PermissionStore;
|
|
cResult[0] = items;
|
|
first = items;
|
|
} else {
|
|
first = cResult[0];
|
|
}
|
|
if (cResult[1] !== arg0) {
|
|
const fn = function l() {
|
|
let tmp = null != closure_0;
|
|
if (tmp) {
|
|
let isPrivateResult = obj.isPrivate();
|
|
if (!isPrivateResult) {
|
|
const obj2 = StreamPermissionUtils;
|
|
isPrivateResult = obj2.canStreamInChannel(obj, GuildStore, PermissionStore, false);
|
|
}
|
|
tmp = isPrivateResult;
|
|
}
|
|
return tmp;
|
|
};
|
|
const items1 = [arg0];
|
|
cResult[1] = arg0;
|
|
cResult[2] = fn;
|
|
cResult[3] = items1;
|
|
tmp8 = items1;
|
|
tmp7 = fn;
|
|
} else {
|
|
tmp7 = cResult[2];
|
|
tmp8 = cResult[3];
|
|
}
|
|
const tmpResult = tmp(504);
|
|
return tmpResult.useStateFromStores(first, tmp7, tmp8);
|
|
}) : ((arg0) => {
|
|
let closure_0;
|
|
_require = arg0;
|
|
const obj = require("get initialized");
|
|
const items = [GuildStore, PermissionStore];
|
|
const items1 = [arg0];
|
|
return obj.useStateFromStores(items, () => {
|
|
let tmp = null != closure_0;
|
|
if (tmp) {
|
|
let isPrivateResult = obj.isPrivate();
|
|
if (!isPrivateResult) {
|
|
const obj2 = StreamPermissionUtils;
|
|
isPrivateResult = obj2.canStreamInChannel(obj, GuildStore, PermissionStore, false);
|
|
}
|
|
tmp = isPrivateResult;
|
|
}
|
|
return tmp;
|
|
}, items1);
|
|
});
|
|
const result = size.fileFinishedImporting("modules/video_calls/useHasVideoPermission.tsx");
|
|
|
|
export default tmp2;
|
|
export const getVideoPermission = function getVideoPermission(channel) {
|
|
let isPrivateResult = channel.isPrivate();
|
|
if (!isPrivateResult) {
|
|
const obj = StreamPermissionUtils;
|
|
isPrivateResult = obj.canStreamInChannel(channel, GuildStore, PermissionStore, false);
|
|
}
|
|
return isPrivateResult;
|
|
};
|