2021-09-10 21:16:44 +08:00
|
|
|
import React from 'react';
|
2019-02-27 01:08:15 +08:00
|
|
|
import { withTracker } from 'meteor/react-meteor-data';
|
|
|
|
import Auth from '/imports/ui/services/auth';
|
2021-10-20 04:35:39 +08:00
|
|
|
import GuestUsers from '/imports/api/guest-users';
|
|
|
|
import Meetings from '/imports/api/meetings';
|
2019-02-27 01:08:15 +08:00
|
|
|
import Service from './service';
|
|
|
|
import WaitingComponent from './component';
|
2021-09-11 04:48:52 +08:00
|
|
|
import { layoutDispatch } from '../layout/context';
|
2019-02-27 01:08:15 +08:00
|
|
|
|
2021-05-18 04:25:07 +08:00
|
|
|
const WaitingContainer = (props) => {
|
2021-09-11 04:48:52 +08:00
|
|
|
const layoutContextDispatch = layoutDispatch();
|
2021-09-10 21:16:44 +08:00
|
|
|
|
2021-08-05 19:03:24 +08:00
|
|
|
return <WaitingComponent {...{ layoutContextDispatch, ...props }} />;
|
2021-05-18 04:25:07 +08:00
|
|
|
};
|
2019-02-27 01:08:15 +08:00
|
|
|
|
|
|
|
export default withTracker(() => {
|
2019-04-04 04:11:47 +08:00
|
|
|
const guestUsers = GuestUsers.find({
|
2019-02-27 01:08:15 +08:00
|
|
|
meetingId: Auth.meetingID,
|
|
|
|
guest: true,
|
|
|
|
approved: false,
|
|
|
|
denied: false,
|
|
|
|
}).fetch();
|
|
|
|
|
|
|
|
const authenticatedUsers = GuestUsers.find({
|
|
|
|
meetingId: Auth.meetingID,
|
|
|
|
authenticated: true,
|
|
|
|
guest: false,
|
|
|
|
approved: false,
|
|
|
|
denied: false,
|
|
|
|
}).fetch();
|
|
|
|
|
2021-05-18 04:25:07 +08:00
|
|
|
const meeting = Meetings.findOne({ meetingId: Auth.meetingID });
|
|
|
|
const { usersProp } = meeting;
|
|
|
|
const { authenticatedGuest } = usersProp;
|
2019-04-10 04:52:48 +08:00
|
|
|
|
2019-02-27 01:08:15 +08:00
|
|
|
return {
|
|
|
|
guestUsers,
|
|
|
|
authenticatedUsers,
|
2022-01-12 22:10:30 +08:00
|
|
|
privateMessageVisible: Service.privateMessageVisible,
|
2019-02-27 01:08:15 +08:00
|
|
|
guestUsersCall: Service.guestUsersCall,
|
2021-09-04 19:45:52 +08:00
|
|
|
isWaitingRoomEnabled: Service.isWaitingRoomEnabled(),
|
2019-04-04 04:11:47 +08:00
|
|
|
changeGuestPolicy: Service.changeGuestPolicy,
|
2020-10-03 01:29:27 +08:00
|
|
|
isGuestLobbyMessageEnabled: Service.isGuestLobbyMessageEnabled,
|
|
|
|
setGuestLobbyMessage: Service.setGuestLobbyMessage,
|
|
|
|
guestLobbyMessage: Service.getGuestLobbyMessage(),
|
2022-01-12 22:10:30 +08:00
|
|
|
privateGuestLobbyMessage: Service.getPrivateGuestLobbyMessage,
|
|
|
|
setPrivateGuestLobbyMessage: Service.setPrivateGuestLobbyMessage,
|
2019-04-10 04:52:48 +08:00
|
|
|
authenticatedGuest,
|
2021-05-13 00:01:04 +08:00
|
|
|
allowRememberChoice: Service.allowRememberChoice,
|
2019-02-27 01:08:15 +08:00
|
|
|
};
|
|
|
|
})(WaitingContainer);
|