Fix error on conference join when calendar is disabled

This commit is contained in:
zbettenbuk 2018-04-24 15:24:10 +02:00 committed by Paweł Domas
parent 68608478f6
commit 54b6db02d8
2 changed files with 22 additions and 2 deletions

View File

@ -10,6 +10,7 @@ import { Icon } from '../../base/font-icons';
import { getLocalizedDateFormatter, translate } from '../../base/i18n';
import { ASPECT_RATIO_NARROW } from '../../base/responsive-ui';
import { CALENDAR_ENABLED } from '../constants';
import styles from './styles';
const ALERT_MILLISECONDS = 5 * 60 * 1000;
@ -278,4 +279,6 @@ function _mapStateToProps(state: Object) {
};
}
export default translate(connect(_mapStateToProps)(ConferenceNotification));
export default CALENDAR_ENABLED
? translate(connect(_mapStateToProps)(ConferenceNotification))
: undefined;

View File

@ -234,7 +234,9 @@ class Conference extends Component<Props> {
</View>
<TestConnectionInfo />
<ConferenceNotification />
{
this._renderConferenceNotification()
}
{/*
* The dialogs are in the topmost stacking layers.
@ -290,6 +292,21 @@ class Conference extends Component<Props> {
return this._backHandler && this.props._onHardwareBackPress();
}
/**
* Renders the conference notification badge if the feature is enabled.
*
* Note: If the calendar feature is disabled on a platform, then we don't
* have its components exported so an undefined check is necessary.
*
* @private
* @returns {React$Node}
*/
_renderConferenceNotification() {
return ConferenceNotification
? <ConferenceNotification />
: undefined;
}
/**
* Triggers the default Toolbox timeout.
*