fix breakout not closing on end
This commit is contained in:
parent
7cd475b2bf
commit
189760d393
@ -2,7 +2,7 @@ import React, { cloneElement } from 'react';
|
||||
import { createContainer } from 'meteor/react-meteor-data';
|
||||
import { withRouter } from 'react-router';
|
||||
import { defineMessages, injectIntl } from 'react-intl';
|
||||
|
||||
import PropTypes from 'prop-types';
|
||||
import Auth from '/imports/ui/services/auth';
|
||||
import Users from '/imports/api/2.0/users';
|
||||
import Breakouts from '/imports/api/2.0/breakouts';
|
||||
@ -13,6 +13,7 @@ import ClosedCaptionsContainer from '/imports/ui/components/closed-captions/cont
|
||||
import {
|
||||
getFontSize,
|
||||
getCaptionsStatus,
|
||||
meetingIsBreakout,
|
||||
} from './service';
|
||||
|
||||
import { withModalMounter } from '../modal/service';
|
||||
@ -22,6 +23,14 @@ import NavBarContainer from '../nav-bar/container';
|
||||
import ActionsBarContainer from '../actions-bar/container';
|
||||
import MediaContainer from '../media/container';
|
||||
|
||||
const propTypes = {
|
||||
navbar: PropTypes.node,
|
||||
actionsbar: PropTypes.node,
|
||||
media: PropTypes.node,
|
||||
location: PropTypes.object.isRequired,
|
||||
children: PropTypes.node.isRequired,
|
||||
};
|
||||
|
||||
const defaultProps = {
|
||||
navbar: <NavBarContainer />,
|
||||
actionsbar: <ActionsBarContainer />,
|
||||
@ -45,10 +54,22 @@ const intlMessages = defineMessages({
|
||||
|
||||
const AppContainer = (props) => {
|
||||
// inject location on the navbar container
|
||||
const navbarWithLocation = cloneElement(props.navbar, { location: props.location });
|
||||
const {
|
||||
navbar,
|
||||
actionsbar,
|
||||
media,
|
||||
...otherProps
|
||||
} = props;
|
||||
|
||||
const navbarWithLocation = cloneElement(navbar, { location: props.location });
|
||||
|
||||
return (
|
||||
<App {...props} navbar={navbarWithLocation}>
|
||||
<App
|
||||
navbar={navbarWithLocation}
|
||||
actionsbar={actionsbar}
|
||||
media={media}
|
||||
{...otherProps}
|
||||
>
|
||||
{props.children}
|
||||
</App>
|
||||
);
|
||||
@ -83,7 +104,9 @@ export default withRouter(injectIntl(withModalMounter(createContainer((
|
||||
// forcelly logged out when the meeting is ended
|
||||
Meetings.find({ meetingId: Auth.meetingID }).observeChanges({
|
||||
removed() {
|
||||
if (!meetingIsBreakout) {
|
||||
sendToError(410, intl.formatMessage(intlMessages.endMeetingMessage));
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
@ -101,3 +124,4 @@ export default withRouter(injectIntl(withModalMounter(createContainer((
|
||||
}, AppContainer))));
|
||||
|
||||
AppContainer.defaultProps = defaultProps;
|
||||
AppContainer.propTypes = propTypes;
|
||||
|
Loading…
Reference in New Issue
Block a user