瀏覽代碼

[RN] Adjust Conference for the reduced UI mode (Coding style)

j8
Lyubo Marinov 7 年之前
父節點
當前提交
0bbcd3181c

+ 7
- 4
react/features/conference/components/Conference.native.js 查看文件

@@ -67,7 +67,8 @@ type Props = {
67 67
     _onHardwareBackPress: Function,
68 68
 
69 69
     /**
70
-     * The indicator which determines if we are in reduced UI mode.
70
+     * The indicator which determines whether the UI is reduced (to accommodate
71
+     * smaller display areas).
71 72
      *
72 73
      * @private
73 74
      */
@@ -200,7 +201,7 @@ class Conference extends Component<Props> {
200 201
                 {/*
201 202
                   * If there is a ringing call, show the callee's info.
202 203
                   */
203
-                    !this.props._reducedUI && <CalleeInfoContainer />
204
+                    this.props._reducedUI || <CalleeInfoContainer />
204 205
                 }
205 206
 
206 207
                 {/*
@@ -232,7 +233,7 @@ class Conference extends Component<Props> {
232 233
                 {/*
233 234
                   * The dialogs are in the topmost stacking layers.
234 235
                   */
235
-                    !this.props._reducedUI && <DialogContainer />
236
+                    this.props._reducedUI || <DialogContainer />
236 237
                 }
237 238
             </Container>
238 239
         );
@@ -370,6 +371,7 @@ function _mapDispatchToProps(dispatch) {
370 371
  * @private
371 372
  * @returns {{
372 373
  *     _connecting: boolean,
374
+ *     _reducedUI: boolean,
373 375
  *     _toolboxVisible: boolean
374 376
  * }}
375 377
  */
@@ -403,7 +405,8 @@ function _mapStateToProps(state) {
403 405
         _connecting: Boolean(connecting_),
404 406
 
405 407
         /**
406
-         * The indicator which determines if we are in reduced UI mode.
408
+         * The indicator which determines whether the UI is reduced (to
409
+         * accommodate smaller display areas).
407 410
          *
408 411
          * @private
409 412
          * @type {boolean}

+ 1
- 2
react/features/conference/index.js 查看文件

@@ -1,5 +1,4 @@
1
-import './route';
2
-
3 1
 export * from './components';
4 2
 
5 3
 import './middleware';
4
+import './route';

+ 5
- 4
react/features/conference/middleware.js 查看文件

@@ -10,12 +10,13 @@ import { MiddlewareRegistry } from '../base/redux';
10 10
 import { setFilmstripEnabled } from '../filmstrip';
11 11
 import { setToolboxEnabled } from '../toolbox';
12 12
 
13
-MiddlewareRegistry.register(({ dispatch, getState }) => next => action => {
13
+MiddlewareRegistry.register(store => next => action => {
14 14
     const result = next(action);
15 15
 
16 16
     switch (action.type) {
17 17
     case CONFERENCE_JOINED:
18 18
     case SET_REDUCED_UI: {
19
+        const { dispatch, getState } = store;
19 20
         const state = getState();
20 21
         const { audioOnly } = state['features/base/conference'];
21 22
         const { reducedUI } = state['features/base/responsive-ui'];
@@ -25,12 +26,12 @@ MiddlewareRegistry.register(({ dispatch, getState }) => next => action => {
25 26
 
26 27
         // XXX: Currently setting the received video quality will disable
27 28
         // audio-only mode if engaged, that's why we check for it here.
28
-        if (!audioOnly) {
29
-            dispatch(setReceiveVideoQuality(
29
+        audioOnly
30
+            || dispatch(
31
+                setReceiveVideoQuality(
30 32
                     reducedUI
31 33
                         ? VIDEO_QUALITY_LEVELS.LOW
32 34
                         : VIDEO_QUALITY_LEVELS.HIGH));
33
-        }
34 35
 
35 36
         break;
36 37
     }

Loading…
取消
儲存