show audio modal when breakout room ends

This commit is contained in:
Tainan Felipe 2017-10-31 14:46:14 -02:00
parent 2b880141fb
commit 6cbd83e51d
2 changed files with 13 additions and 10 deletions

View File

@ -117,15 +117,7 @@ export default withRouter(injectIntl(withModalMounter(createContainer((
Auth.clearCredentials().then(window.close);
},
});
Breakouts.find().observeChanges({
removed() {
notify('fechou a breakout room');
if(wasInAudio) {
notify('join audio');
}
},
});
return {
closedCaption: getCaptionsStatus() ? <ClosedCaptionsContainer /> : null,
fontSize: getFontSize(),

View File

@ -2,6 +2,7 @@ import React from 'react';
import { createContainer } from 'meteor/react-meteor-data';
import { withModalMounter } from '/imports/ui/components/modal/service';
import PropTypes from 'prop-types';
import Breakouts from '/imports/api/2.0/breakouts';
import Service from './service';
import Audio from './component';
import AudioModal from './audio-modal/component';
@ -26,12 +27,22 @@ export default withModalMounter(createContainer(({ mountModal }) => {
const APP_CONFIG = Meteor.settings.public.app;
const { autoJoinAudio } = APP_CONFIG;
const openAudioModal = mountModal.bind(null,
<AudioModal
handleJoinListenOnly={Service.joinListenOnly}
/>);
Breakouts.find().observeChanges({
removed() {
openAudioModal();
},
});
return {
init: () => {
Service.init();
if (!autoJoinAudio || didMountAutoJoin) return;
mountModal(<AudioModal handleJoinListenOnly={Service.joinListenOnly} />);
openAudioModal();
didMountAutoJoin = true;
},
};