Bläddra i källkod

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

j8
Lyubo Marinov 7 år sedan
förälder
incheckning
0bbcd3181c

+ 7
- 4
react/features/conference/components/Conference.native.js Visa fil

67
     _onHardwareBackPress: Function,
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
      * @private
73
      * @private
73
      */
74
      */
200
                 {/*
201
                 {/*
201
                   * If there is a ringing call, show the callee's info.
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
                 {/*
233
                 {/*
233
                   * The dialogs are in the topmost stacking layers.
234
                   * The dialogs are in the topmost stacking layers.
234
                   */
235
                   */
235
-                    !this.props._reducedUI && <DialogContainer />
236
+                    this.props._reducedUI || <DialogContainer />
236
                 }
237
                 }
237
             </Container>
238
             </Container>
238
         );
239
         );
370
  * @private
371
  * @private
371
  * @returns {{
372
  * @returns {{
372
  *     _connecting: boolean,
373
  *     _connecting: boolean,
374
+ *     _reducedUI: boolean,
373
  *     _toolboxVisible: boolean
375
  *     _toolboxVisible: boolean
374
  * }}
376
  * }}
375
  */
377
  */
403
         _connecting: Boolean(connecting_),
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
          * @private
411
          * @private
409
          * @type {boolean}
412
          * @type {boolean}

+ 1
- 2
react/features/conference/index.js Visa fil

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

+ 5
- 4
react/features/conference/middleware.js Visa fil

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

Laddar…
Avbryt
Spara