bigbluebutton-Github/bigbluebutton-html5/imports/ui/components/waiting-users/service.js
Ramón Souza 7514066fc3
fix: Client can't load in certain cases (#20336)
* move settings

* remove meteor cache files
2024-05-29 09:26:11 -04:00

41 lines
971 B
JavaScript

import Meetings from '/imports/api/meetings';
import Auth from '/imports/ui/services/auth';
const getGuestPolicy = () => {
const meeting = Meetings.findOne(
{ meetingId: Auth.meetingID },
{ fields: { 'usersPolicies.guestPolicy': 1 } },
);
return meeting.usersPolicies.guestPolicy;
};
const isWaitingRoomEnabled = () => getGuestPolicy() === 'ASK_MODERATOR';
const getGuestLobbyMessage = () => {
const meeting = Meetings.findOne(
{ meetingId: Auth.meetingID },
{ fields: { guestLobbyMessage: 1 } },
);
if (meeting) return meeting.guestLobbyMessage;
return '';
};
const privateMessageVisible = (id) => {
const privateInputSpace = document.getElementById(id);
if (privateInputSpace.style.display === 'block') {
privateInputSpace.style.display = 'none';
} else {
privateInputSpace.style.display = 'block';
}
};
export default {
privateMessageVisible,
getGuestPolicy,
isWaitingRoomEnabled,
getGuestLobbyMessage,
};