|
|
@@ -61,7 +61,7 @@ type Props = {
|
|
61
|
61
|
_onHardwareBackPress: Function,
|
|
62
|
62
|
|
|
63
|
63
|
/**
|
|
64
|
|
- * Number of participants in the conference.
|
|
|
64
|
+ * The number of participants in the conference.
|
|
65
|
65
|
*
|
|
66
|
66
|
* @private
|
|
67
|
67
|
*/
|
|
|
@@ -129,12 +129,10 @@ class Conference extends Component<Props> {
|
|
129
|
129
|
this._onHardwareBackPress);
|
|
130
|
130
|
}
|
|
131
|
131
|
|
|
132
|
|
- // Show the toolbar if we are the only participant.
|
|
|
132
|
+ // Show the toolbox if we are the only participant.
|
|
133
|
133
|
const { _participantCount, _setToolboxVisible } = this.props;
|
|
134
|
134
|
|
|
135
|
|
- if (_participantCount === 1) {
|
|
136
|
|
- _setToolboxVisible(true);
|
|
137
|
|
- }
|
|
|
135
|
+ _participantCount === 1 && _setToolboxVisible(true);
|
|
138
|
136
|
}
|
|
139
|
137
|
|
|
140
|
138
|
/**
|
|
|
@@ -159,14 +157,16 @@ class Conference extends Component<Props> {
|
|
159
|
157
|
* that this instance will receive.
|
|
160
|
158
|
* @returns {void}
|
|
161
|
159
|
*/
|
|
162
|
|
- componentWillReceiveProps(nextProps) {
|
|
163
|
|
- const oldParticipantCount = this.props._participantCount;
|
|
164
|
|
- const newParticipantCount = nextProps._participantCount;
|
|
165
|
|
-
|
|
166
|
|
- if (oldParticipantCount === 1 && newParticipantCount > 1) {
|
|
167
|
|
- this.props._setToolboxVisible(false);
|
|
168
|
|
- } else if (oldParticipantCount > 1 && newParticipantCount === 1) {
|
|
169
|
|
- this.props._setToolboxVisible(true);
|
|
|
160
|
+ componentWillReceiveProps({ _participantCount: newParticipantCount }) {
|
|
|
161
|
+ const {
|
|
|
162
|
+ _participantCount: oldParticipantCount,
|
|
|
163
|
+ _setToolboxVisible
|
|
|
164
|
+ } = this.props;
|
|
|
165
|
+
|
|
|
166
|
+ if (oldParticipantCount === 1) {
|
|
|
167
|
+ newParticipantCount > 1 && _setToolboxVisible(false);
|
|
|
168
|
+ } else if (oldParticipantCount > 1) {
|
|
|
169
|
+ newParticipantCount === 1 && _setToolboxVisible(true);
|
|
170
|
170
|
}
|
|
171
|
171
|
}
|
|
172
|
172
|
|
|
|
@@ -373,6 +373,7 @@ function _mapDispatchToProps(dispatch) {
|
|
373
|
373
|
* @private
|
|
374
|
374
|
* @returns {{
|
|
375
|
375
|
* _connecting: boolean,
|
|
|
376
|
+ * _participantCount: number,
|
|
376
|
377
|
* _reducedUI: boolean,
|
|
377
|
378
|
* _toolboxVisible: boolean
|
|
378
|
379
|
* }}
|
|
|
@@ -408,7 +409,7 @@ function _mapStateToProps(state) {
|
|
408
|
409
|
_connecting: Boolean(connecting_),
|
|
409
|
410
|
|
|
410
|
411
|
/**
|
|
411
|
|
- * Number of participants in the conference.
|
|
|
412
|
+ * The number of participants in the conference.
|
|
412
|
413
|
*
|
|
413
|
414
|
* @private
|
|
414
|
415
|
* @type {number}
|