|
|
@@ -5,7 +5,6 @@ import React from 'react';
|
|
5
|
5
|
import { BackHandler, SafeAreaView, StatusBar, View } from 'react-native';
|
|
6
|
6
|
|
|
7
|
7
|
import { appNavigate } from '../../../app';
|
|
8
|
|
-import { connect, disconnect } from '../../../base/connection';
|
|
9
|
8
|
import { getParticipantCount } from '../../../base/participants';
|
|
10
|
9
|
import { Container, LoadingIndicator, TintedView } from '../../../base/react';
|
|
11
|
10
|
import { connect as reactReduxConnect } from '../../../base/redux';
|
|
|
@@ -14,7 +13,6 @@ import {
|
|
14
|
13
|
makeAspectRatioAware
|
|
15
|
14
|
} from '../../../base/responsive-ui';
|
|
16
|
15
|
import { TestConnectionInfo } from '../../../base/testing';
|
|
17
|
|
-import { createDesiredLocalTracks } from '../../../base/tracks';
|
|
18
|
16
|
import { ConferenceNotification } from '../../../calendar-sync';
|
|
19
|
17
|
import { Chat } from '../../../chat';
|
|
20
|
18
|
import { DisplayNameLabel } from '../../../display-name';
|
|
|
@@ -66,29 +64,6 @@ type Props = AbstractProps & {
|
|
66
|
64
|
*/
|
|
67
|
65
|
_largeVideoParticipantId: string,
|
|
68
|
66
|
|
|
69
|
|
- /**
|
|
70
|
|
- * Current conference's full URL.
|
|
71
|
|
- *
|
|
72
|
|
- * @private
|
|
73
|
|
- */
|
|
74
|
|
- _locationURL: URL,
|
|
75
|
|
-
|
|
76
|
|
- /**
|
|
77
|
|
- * The handler which dispatches the (redux) action connect.
|
|
78
|
|
- *
|
|
79
|
|
- * @private
|
|
80
|
|
- * @returns {void}
|
|
81
|
|
- */
|
|
82
|
|
- _onConnect: Function,
|
|
83
|
|
-
|
|
84
|
|
- /**
|
|
85
|
|
- * The handler which dispatches the (redux) action disconnect.
|
|
86
|
|
- *
|
|
87
|
|
- * @private
|
|
88
|
|
- * @returns {void}
|
|
89
|
|
- */
|
|
90
|
|
- _onDisconnect: Function,
|
|
91
|
|
-
|
|
92
|
67
|
/**
|
|
93
|
68
|
* Handles a hardware button press for back navigation. Leaves the
|
|
94
|
69
|
* associated {@code Conference}.
|
|
|
@@ -166,8 +141,6 @@ class Conference extends AbstractConference<Props, *> {
|
|
166
|
141
|
* @returns {void}
|
|
167
|
142
|
*/
|
|
168
|
143
|
componentDidMount() {
|
|
169
|
|
- this.props._onConnect();
|
|
170
|
|
-
|
|
171
|
144
|
BackHandler.addEventListener(
|
|
172
|
145
|
'hardwareBackPress',
|
|
173
|
146
|
this.props._onHardwareBackPress);
|
|
|
@@ -184,26 +157,16 @@ class Conference extends AbstractConference<Props, *> {
|
|
184
|
157
|
*
|
|
185
|
158
|
* @inheritdoc
|
|
186
|
159
|
*/
|
|
187
|
|
- componentDidUpdate(pevProps: Props) {
|
|
|
160
|
+ componentDidUpdate(prevProps: Props) {
|
|
188
|
161
|
const {
|
|
189
|
|
- _locationURL: oldLocationURL,
|
|
190
|
|
- _participantCount: oldParticipantCount,
|
|
191
|
|
- _room: oldRoom
|
|
192
|
|
- } = pevProps;
|
|
|
162
|
+ _participantCount: oldParticipantCount
|
|
|
163
|
+ } = prevProps;
|
|
193
|
164
|
const {
|
|
194
|
|
- _locationURL: newLocationURL,
|
|
195
|
165
|
_participantCount: newParticipantCount,
|
|
196
|
|
- _room: newRoom,
|
|
197
|
166
|
_setToolboxVisible,
|
|
198
|
167
|
_toolboxVisible
|
|
199
|
168
|
} = this.props;
|
|
200
|
169
|
|
|
201
|
|
- // If the location URL changes we need to reconnect.
|
|
202
|
|
- oldLocationURL !== newLocationURL && newRoom && this.props._onDisconnect();
|
|
203
|
|
-
|
|
204
|
|
- // Start the connection process when there is a (valid) room.
|
|
205
|
|
- oldRoom !== newRoom && newRoom && this.props._onConnect();
|
|
206
|
|
-
|
|
207
|
170
|
if (oldParticipantCount === 1
|
|
208
|
171
|
&& newParticipantCount > 1
|
|
209
|
172
|
&& _toolboxVisible) {
|
|
|
@@ -228,8 +191,6 @@ class Conference extends AbstractConference<Props, *> {
|
|
228
|
191
|
BackHandler.removeEventListener(
|
|
229
|
192
|
'hardwareBackPress',
|
|
230
|
193
|
this.props._onHardwareBackPress);
|
|
231
|
|
-
|
|
232
|
|
- this.props._onDisconnect();
|
|
233
|
194
|
}
|
|
234
|
195
|
|
|
235
|
196
|
/**
|
|
|
@@ -396,36 +357,12 @@ class Conference extends AbstractConference<Props, *> {
|
|
396
|
357
|
* @param {Function} dispatch - Redux action dispatcher.
|
|
397
|
358
|
* @private
|
|
398
|
359
|
* @returns {{
|
|
399
|
|
- * _onConnect: Function,
|
|
400
|
|
- * _onDisconnect: Function,
|
|
401
|
360
|
* _onHardwareBackPress: Function,
|
|
402
|
361
|
* _setToolboxVisible: Function
|
|
403
|
362
|
* }}
|
|
404
|
363
|
*/
|
|
405
|
364
|
function _mapDispatchToProps(dispatch) {
|
|
406
|
365
|
return {
|
|
407
|
|
- /**
|
|
408
|
|
- * Dispatches actions to create the desired local tracks and for
|
|
409
|
|
- * connecting to the conference.
|
|
410
|
|
- *
|
|
411
|
|
- * @private
|
|
412
|
|
- * @returns {void}
|
|
413
|
|
- */
|
|
414
|
|
- _onConnect() {
|
|
415
|
|
- dispatch(createDesiredLocalTracks());
|
|
416
|
|
- dispatch(connect());
|
|
417
|
|
- },
|
|
418
|
|
-
|
|
419
|
|
- /**
|
|
420
|
|
- * Dispatches an action disconnecting from the conference.
|
|
421
|
|
- *
|
|
422
|
|
- * @private
|
|
423
|
|
- * @returns {void}
|
|
424
|
|
- */
|
|
425
|
|
- _onDisconnect() {
|
|
426
|
|
- dispatch(disconnect());
|
|
427
|
|
- },
|
|
428
|
|
-
|
|
429
|
366
|
/**
|
|
430
|
367
|
* Handles a hardware button press for back navigation. Leaves the
|
|
431
|
368
|
* associated {@code Conference}.
|
|
|
@@ -462,8 +399,7 @@ function _mapDispatchToProps(dispatch) {
|
|
462
|
399
|
* @returns {Props}
|
|
463
|
400
|
*/
|
|
464
|
401
|
function _mapStateToProps(state) {
|
|
465
|
|
- const { connecting, connection, locationURL }
|
|
466
|
|
- = state['features/base/connection'];
|
|
|
402
|
+ const { connecting, connection } = state['features/base/connection'];
|
|
467
|
403
|
const {
|
|
468
|
404
|
conference,
|
|
469
|
405
|
joining,
|
|
|
@@ -508,14 +444,6 @@ function _mapStateToProps(state) {
|
|
508
|
444
|
*/
|
|
509
|
445
|
_largeVideoParticipantId: state['features/large-video'].participantId,
|
|
510
|
446
|
|
|
511
|
|
- /**
|
|
512
|
|
- * Current conference's full URL.
|
|
513
|
|
- *
|
|
514
|
|
- * @private
|
|
515
|
|
- * @type {URL}
|
|
516
|
|
- */
|
|
517
|
|
- _locationURL: locationURL,
|
|
518
|
|
-
|
|
519
|
447
|
/**
|
|
520
|
448
|
* The number of participants in the conference.
|
|
521
|
449
|
*
|