From 99788090ee1222f87e28942b27d6ab1d9a212785 Mon Sep 17 00:00:00 2001 From: Matthew Marangoni Date: Wed, 3 May 2017 14:39:07 -0700 Subject: [PATCH] fixed audio and settings modal reopening when changing locale in settings --- .../imports/ui/components/app/component.jsx | 3 --- .../imports/ui/components/app/container.jsx | 9 --------- .../imports/ui/components/audio/container.jsx | 9 +++++---- .../imports/ui/components/settings/component.jsx | 4 +++- 4 files changed, 8 insertions(+), 17 deletions(-) diff --git a/bigbluebutton-html5/imports/ui/components/app/component.jsx b/bigbluebutton-html5/imports/ui/components/app/component.jsx index 888e8d3df5..f370636ffc 100755 --- a/bigbluebutton-html5/imports/ui/components/app/component.jsx +++ b/bigbluebutton-html5/imports/ui/components/app/component.jsx @@ -33,7 +33,6 @@ const intlMessages = defineMessages({ }); const propTypes = { - init: PropTypes.func.isRequired, fontSize: PropTypes.string, navbar: PropTypes.element, sidebar: PropTypes.element, @@ -52,8 +51,6 @@ class App extends Component { this.state = { compactUserList: false, //TODO: Change this on userlist resize (?) }; - - props.init.call(this); } componentDidMount() { diff --git a/bigbluebutton-html5/imports/ui/components/app/container.jsx b/bigbluebutton-html5/imports/ui/components/app/container.jsx index a0d8a88597..6bdf48dad3 100755 --- a/bigbluebutton-html5/imports/ui/components/app/container.jsx +++ b/bigbluebutton-html5/imports/ui/components/app/container.jsx @@ -72,16 +72,7 @@ export default withRouter(injectIntl(withModalMounter(createContainer(( }, }); - const APP_CONFIG = Meteor.settings.public.app; - - const init = () => { - if (APP_CONFIG.autoJoinAudio) { - mountModal(); - } - }; - return { - init, sidebar: getCaptionsStatus() ? : null, fontSize: getFontSize(), }; diff --git a/bigbluebutton-html5/imports/ui/components/audio/container.jsx b/bigbluebutton-html5/imports/ui/components/audio/container.jsx index 5bb8ff3fe9..87453c103e 100755 --- a/bigbluebutton-html5/imports/ui/components/audio/container.jsx +++ b/bigbluebutton-html5/imports/ui/components/audio/container.jsx @@ -16,16 +16,17 @@ class AudioContainer extends Component { } } +let didMountedAutoJoin = false; + export default withModalMounter(createContainer(({ mountModal }) => { const APP_CONFIG = Meteor.settings.public.app; return { init: () => { Service.init(); - - if (APP_CONFIG.autoJoinAudio) { - mountModal(); - } + if (didMountedAutoJoin) return; + mountModal(); + didMountedAutoJoin = true; }, }; }, AudioContainer)); diff --git a/bigbluebutton-html5/imports/ui/components/settings/component.jsx b/bigbluebutton-html5/imports/ui/components/settings/component.jsx index 5597113d5f..9d040ee4ab 100755 --- a/bigbluebutton-html5/imports/ui/components/settings/component.jsx +++ b/bigbluebutton-html5/imports/ui/components/settings/component.jsx @@ -2,6 +2,7 @@ import React, { Component } from 'react'; import Modal from '/imports/ui/components/modal/fullscreen/component'; import { Tab, Tabs, TabList, TabPanel } from 'react-tabs'; import { defineMessages, injectIntl } from 'react-intl'; +import { withModalMounter } from '../modal/service'; import ClosedCaptions from '/imports/ui/components/settings/submenus/closed-captions/component'; import Application from '/imports/ui/components/settings/submenus/application/container'; import Participants from '/imports/ui/components/settings/submenus/participants/component'; @@ -105,6 +106,7 @@ class Settings extends Component { title={intl.formatMessage(intlMessages.SettingsLabel)} confirm={{ callback: (() => { + this.props.mountModal(null); this.updateSettings(this.state.current); }), label: intl.formatMessage(intlMessages.SaveLabel), @@ -199,4 +201,4 @@ class Settings extends Component { } Settings.propTypes = propTypes; -export default injectIntl(Settings); +export default withModalMounter(injectIntl(Settings));