|
@@ -1,9 +1,11 @@
|
|
1
|
+import PropTypes from 'prop-types';
|
1
|
2
|
import React, { Component } from 'react';
|
|
3
|
+import { View } from 'react-native';
|
2
|
4
|
import { connect as reactReduxConnect } from 'react-redux';
|
3
|
5
|
|
4
|
6
|
import { connect, disconnect } from '../../base/connection';
|
5
|
7
|
import { DialogContainer } from '../../base/dialog';
|
6
|
|
-import { Container } from '../../base/react';
|
|
8
|
+import { Container, LoadingIndicator } from '../../base/react';
|
7
|
9
|
import { createDesiredLocalTracks } from '../../base/tracks';
|
8
|
10
|
import { Filmstrip } from '../../filmstrip';
|
9
|
11
|
import { LargeVideo } from '../../large-video';
|
|
@@ -30,38 +32,44 @@ class Conference extends Component {
|
30
|
32
|
* @static
|
31
|
33
|
*/
|
32
|
34
|
static propTypes = {
|
|
35
|
+ /**
|
|
36
|
+ * The indicator which determines that we are still connecting to the
|
|
37
|
+ * conference which includes establishing the XMPP connection and then
|
|
38
|
+ * joining the room. If truthy, then an activity/loading indicator will
|
|
39
|
+ * be rendered.
|
|
40
|
+ *
|
|
41
|
+ * @private
|
|
42
|
+ */
|
|
43
|
+ _connecting: PropTypes.bool,
|
|
44
|
+
|
33
|
45
|
/**
|
34
|
46
|
* The handler which dispatches the (redux) action connect.
|
35
|
47
|
*
|
36
|
48
|
* @private
|
37
|
|
- * @type {Function}
|
38
|
49
|
*/
|
39
|
|
- _onConnect: React.PropTypes.func,
|
|
50
|
+ _onConnect: PropTypes.func,
|
40
|
51
|
|
41
|
52
|
/**
|
42
|
53
|
* The handler which dispatches the (redux) action disconnect.
|
43
|
54
|
*
|
44
|
55
|
* @private
|
45
|
|
- * @type {Function}
|
46
|
56
|
*/
|
47
|
|
- _onDisconnect: React.PropTypes.func,
|
|
57
|
+ _onDisconnect: PropTypes.func,
|
48
|
58
|
|
49
|
59
|
/**
|
50
|
60
|
* The handler which dispatches the (redux) action setToolboxVisible to
|
51
|
61
|
* show/hide the Toolbox.
|
52
|
62
|
*
|
53
|
63
|
* @private
|
54
|
|
- * @type {boolean}
|
55
|
64
|
*/
|
56
|
|
- _setToolboxVisible: React.PropTypes.func,
|
|
65
|
+ _setToolboxVisible: PropTypes.func,
|
57
|
66
|
|
58
|
67
|
/**
|
59
|
68
|
* The indicator which determines whether the Toolbox is visible.
|
60
|
69
|
*
|
61
|
70
|
* @private
|
62
|
|
- * @type {boolean}
|
63
|
71
|
*/
|
64
|
|
- _toolboxVisible: React.PropTypes.bool
|
|
72
|
+ _toolboxVisible: PropTypes.bool
|
65
|
73
|
};
|
66
|
74
|
|
67
|
75
|
/**
|
|
@@ -152,6 +160,16 @@ class Conference extends Component {
|
152
|
160
|
*/}
|
153
|
161
|
<OverlayContainer />
|
154
|
162
|
|
|
163
|
+ {/*
|
|
164
|
+ * The activity/loading indicator goes above everything, except
|
|
165
|
+ * the toolbox/toolbars and the dialogs.
|
|
166
|
+ */
|
|
167
|
+ this.props._connecting
|
|
168
|
+ && <View style = { styles.connectingIndicator }>
|
|
169
|
+ <LoadingIndicator />
|
|
170
|
+ </View>
|
|
171
|
+ }
|
|
172
|
+
|
155
|
173
|
{/*
|
156
|
174
|
* The Toolbox is in a stacking layer above the Filmstrip.
|
157
|
175
|
*/}
|
|
@@ -264,11 +282,38 @@ function _mapDispatchToProps(dispatch) {
|
264
|
282
|
* @param {Object} state - The Redux state.
|
265
|
283
|
* @private
|
266
|
284
|
* @returns {{
|
|
285
|
+ * _connecting: boolean,
|
267
|
286
|
* _toolboxVisible: boolean
|
268
|
287
|
* }}
|
269
|
288
|
*/
|
270
|
289
|
function _mapStateToProps(state) {
|
|
290
|
+ const { connecting, connection } = state['features/base/connection'];
|
|
291
|
+ const { conference, joining, leaving } = state['features/base/conference'];
|
|
292
|
+
|
|
293
|
+ // XXX There is a window of time between the successful establishment of the
|
|
294
|
+ // XMPP connection and the subsequent commencement of joining the MUC during
|
|
295
|
+ // which the app does not appear to be doing anything according to the redux
|
|
296
|
+ // state. In order to not toggle the _connecting props during the window of
|
|
297
|
+ // time in question, define _connecting as follows:
|
|
298
|
+ // - the XMPP connection is connecting, or
|
|
299
|
+ // - the XMPP connection is connected and the conference is joining, or
|
|
300
|
+ // - the XMPP connection is connected and we have no conference yet, nor we
|
|
301
|
+ // are leaving one.
|
|
302
|
+ const connecting_
|
|
303
|
+ = connecting || (connection && (joining || (!conference && !leaving)));
|
|
304
|
+
|
271
|
305
|
return {
|
|
306
|
+ /**
|
|
307
|
+ * The indicator which determines that we are still connecting to the
|
|
308
|
+ * conference which includes establishing the XMPP connection and then
|
|
309
|
+ * joining the room. If truthy, then an activity/loading indicator will
|
|
310
|
+ * be rendered.
|
|
311
|
+ *
|
|
312
|
+ * @private
|
|
313
|
+ * @type {boolean}
|
|
314
|
+ */
|
|
315
|
+ _connecting: Boolean(connecting_),
|
|
316
|
+
|
272
|
317
|
/**
|
273
|
318
|
* The indicator which determines whether the Toolbox is visible.
|
274
|
319
|
*
|