Skipped 1 file(s) >100MB (GitHub limit): source/__polyfill/04xxx/module_4973.js (118.4 MB)
50 lines
2.1 KiB
TypeScript
50 lines
2.1 KiB
TypeScript
// Module ID: 9942
|
|
// Function ID: 9943
|
|
// Name: useChannelVideoLimit
|
|
// Dependencies: [2063, 4812, 1074, 504, 2]
|
|
// Exports: default, getChannelVideoLimit
|
|
|
|
// Module 9942 (useChannelVideoLimit)
|
|
import GuildStore from "GuildStore" /* 2063 */;
|
|
import SortedVoiceStateStore from "SortedVoiceStateStore" /* 4812 */;
|
|
|
|
const require = globalThis.__r;
|
|
|
|
const require = fn;
|
|
const ChannelTypes = fn(1074).ChannelTypes;
|
|
const size = fn(2);
|
|
let result = size.fileFinishedImporting("modules/video_calls/useChannelVideoLimit.tsx");
|
|
|
|
export default function useChannelVideoLimit(arg0) {
|
|
_require = arg0;
|
|
const items = [SortedVoiceStateStore, GuildStore];
|
|
const items1 = [arg0];
|
|
return require("initialize").useStateFromStoresObject(items, () => {
|
|
const result = SortedVoiceStateStore.countVoiceStatesForChannel(guildId.id);
|
|
const guild = GuildStore.getGuild(guildId.getGuildId());
|
|
if (null == guild) {
|
|
let obj = { reachedLimit: false, limit: -1 };
|
|
} else if (guildId.type === ChannelTypes.GUILD_STAGE_VOICE) {
|
|
const obj2 = { reachedLimit: result > guild.maxStageVideoChannelUsers, limit: guild.maxStageVideoChannelUsers };
|
|
obj = obj2;
|
|
} else {
|
|
obj = { reachedLimit: guild.maxVideoChannelUsers > 0 && result > guild.maxVideoChannelUsers, limit: guild.maxVideoChannelUsers };
|
|
const tmp5 = guild.maxVideoChannelUsers > 0 && result > guild.maxVideoChannelUsers;
|
|
}
|
|
return obj;
|
|
}, items1);
|
|
};
|
|
export const getChannelVideoLimit = function getChannelVideoLimit(channel) {
|
|
const result = SortedVoiceStateStore.countVoiceStatesForChannel(channel.id);
|
|
const guild = GuildStore.getGuild(channel.getGuildId());
|
|
if (null == guild) {
|
|
let obj = { reachedLimit: false, limit: -1 };
|
|
} else if (channel.type === ChannelTypes.GUILD_STAGE_VOICE) {
|
|
const obj2 = { reachedLimit: result > guild.maxStageVideoChannelUsers, limit: guild.maxStageVideoChannelUsers };
|
|
obj = obj2;
|
|
} else {
|
|
obj = { reachedLimit: guild.maxVideoChannelUsers > 0 && result > guild.maxVideoChannelUsers, limit: guild.maxVideoChannelUsers };
|
|
const tmp4 = guild.maxVideoChannelUsers > 0 && result > guild.maxVideoChannelUsers;
|
|
}
|
|
return obj;
|
|
};
|