Bläddra i källkod

Coding style: formatting, comments

master
Lyubo Marinov 7 år sedan
förälder
incheckning
21c1e4abc4

+ 15
- 14
react/features/conference/components/Conference.native.js Visa fil

61
     _onHardwareBackPress: Function,
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
      * @private
66
      * @private
67
      */
67
      */
129
                 this._onHardwareBackPress);
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
         const { _participantCount, _setToolboxVisible } = this.props;
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
      * that this instance will receive.
157
      * that this instance will receive.
160
      * @returns {void}
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
  * @private
373
  * @private
374
  * @returns {{
374
  * @returns {{
375
  *     _connecting: boolean,
375
  *     _connecting: boolean,
376
+ *     _participantCount: number,
376
  *     _reducedUI: boolean,
377
  *     _reducedUI: boolean,
377
  *     _toolboxVisible: boolean
378
  *     _toolboxVisible: boolean
378
  * }}
379
  * }}
408
         _connecting: Boolean(connecting_),
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
          * @private
414
          * @private
414
          * @type {number}
415
          * @type {number}

+ 2
- 5
react/features/toolbox/reducer.js Visa fil

1
 // @flow
1
 // @flow
2
 
2
 
3
-import { ReducerRegistry } from '../base/redux';
3
+import { ReducerRegistry, set } from '../base/redux';
4
 
4
 
5
 import {
5
 import {
6
     CLEAR_TOOLBOX_TIMEOUT,
6
     CLEAR_TOOLBOX_TIMEOUT,
149
             };
149
             };
150
 
150
 
151
         case SET_TOOLBOX_VISIBLE:
151
         case SET_TOOLBOX_VISIBLE:
152
-            return {
153
-                ...state,
154
-                visible: action.visible
155
-            };
152
+            return set(state, 'visible', action.visible);
156
         }
153
         }
157
 
154
 
158
         return state;
155
         return state;

Laddar…
Avbryt
Spara