Przeglądaj źródła

Fix typos. Apply consistent formatting

master
Lyubo Marinov 8 lat temu
rodzic
commit
b62b296080
2 zmienionych plików z 53 dodań i 55 usunięć
  1. 30
    39
      conference.js
  2. 23
    16
      react/features/base/tracks/actions.js

+ 30
- 39
conference.js Wyświetl plik

@@ -1256,40 +1256,36 @@ export default {
1256 1256
             devices: ['desktop'],
1257 1257
             desktopSharingExtensionExternalInstallation: {
1258 1258
                 interval: 500,
1259
-                checkAgain: () => {
1260
-                    return DSExternalInstallationInProgress;
1261
-                },
1259
+                checkAgain: () => DSExternalInstallationInProgress,
1262 1260
                 listener: (status, url) => {
1263 1261
                     switch(status) {
1264
-                        case "waitingForExtension": {
1265
-                            DSExternalInstallationInProgress = true;
1266
-                            externalInstallation = true;
1267
-                            const listener = () => {
1268
-                                // Wait a little bit more just to be sure that
1269
-                                // we won't miss the extension installation
1270
-                                setTimeout(
1271
-                                    () => {
1262
+                    case "waitingForExtension": {
1263
+                        DSExternalInstallationInProgress = true;
1264
+                        externalInstallation = true;
1265
+                        const listener = () => {
1266
+                            // Wait a little bit more just to be sure that we
1267
+                            // won't miss the extension installation
1268
+                            setTimeout(
1269
+                                () => {
1272 1270
                                     DSExternalInstallationInProgress = false;
1273
-                                    }, 500);
1274
-                                APP.UI.removeListener(
1275
-                                    UIEvents.EXTERNAL_INSTALLATION_CANCELED,
1276
-                                    listener);
1277
-                            };
1278
-                            APP.UI.addListener(
1271
+                                },
1272
+                                500);
1273
+                            APP.UI.removeListener(
1279 1274
                                 UIEvents.EXTERNAL_INSTALLATION_CANCELED,
1280 1275
                                 listener);
1281
-                            APP.UI.showExtensionExternalInstallationDialog(url);
1282
-                            break;
1283
-                        }
1284
-                        case "extensionFound": {
1285
-                            if (externalInstallation) { //close the dialog
1286
-                                $.prompt.close();
1287
-                            }
1288
-                            break;
1289
-                        }
1290
-                        default: {
1291
-                            //Unknown status
1292
-                        }
1276
+                        };
1277
+                        APP.UI.addListener(
1278
+                            UIEvents.EXTERNAL_INSTALLATION_CANCELED,
1279
+                            listener);
1280
+                        APP.UI.showExtensionExternalInstallationDialog(url);
1281
+                        break;
1282
+                    }
1283
+                    case "extensionFound":
1284
+                        // Close the dialog.
1285
+                        externalInstallation && $.prompt.close();
1286
+                        break;
1287
+                    default:
1288
+                        // Unknown status
1293 1289
                     }
1294 1290
                 }
1295 1291
             }
@@ -1304,23 +1300,18 @@ export default {
1304 1300
                 () => {
1305 1301
                     // If the stream was stopped during screen sharing
1306 1302
                     // session then we should switch back to video.
1307
-                    if (this.isSharingScreen) {
1308
-                        this._untoggleScreenSharing
1309
-                            && this._untoggleScreenSharing();
1310
-                    }
1303
+                    this.isSharingScreen
1304
+                        && this._untoggleScreenSharing
1305
+                        && this._untoggleScreenSharing();
1311 1306
                 }
1312 1307
             );
1313 1308
             // close external installation dialog on success.
1314
-            if (externalInstallation) {
1315
-                $.prompt.close();
1316
-            }
1309
+            externalInstallation && $.prompt.close();
1317 1310
             return desktopStream;
1318 1311
         }, error => {
1319 1312
             DSExternalInstallationInProgress = false;
1320 1313
             // close external installation dialog on success.
1321
-            if (externalInstallation) {
1322
-                $.prompt.close();
1323
-            }
1314
+            externalInstallation && $.prompt.close();
1324 1315
             throw error;
1325 1316
         });
1326 1317
     },

+ 23
- 16
react/features/base/tracks/actions.js Wyświetl plik

@@ -1,7 +1,4 @@
1
-import JitsiMeetJS, {
2
-    JitsiTrackErrors,
3
-    JitsiTrackEvents
4
-} from '../lib-jitsi-meet';
1
+import { JitsiTrackErrors, JitsiTrackEvents } from '../lib-jitsi-meet';
5 2
 import {
6 3
     CAMERA_FACING_MODE,
7 4
     MEDIA_TYPE,
@@ -78,13 +75,13 @@ export function destroyLocalTracks() {
78 75
 
79 76
 /**
80 77
  * Replaces one track with another for one renegotiation instead of invoking
81
- * two renegotations with a separate removeTrack and addTrack. Disposes the
78
+ * two renegotiations with a separate removeTrack and addTrack. Disposes the
82 79
  * removed track as well.
83 80
  *
84 81
  * @param {JitsiLocalTrack|null} oldTrack - The track to dispose.
85 82
  * @param {JitsiLocalTrack|null} newTrack - The track to use instead.
86 83
  * @param {JitsiConference} [conference] - The conference from which to remove
87
- * and add the tracks. If one is not provied, the conference in the redux store
84
+ * and add the tracks. If one is not provided, the conference in the redux store
88 85
  * will be used.
89 86
  * @returns {Function}
90 87
  */
@@ -182,7 +179,10 @@ export function trackAdded(track) {
182 179
  * changed.
183 180
  *
184 181
  * @param {(JitsiLocalTrack|JitsiRemoteTrack)} track - JitsiTrack instance.
185
- * @returns {{ type: TRACK_UPDATED, track: Track }}
182
+ * @returns {{
183
+ *     type: TRACK_UPDATED,
184
+ *     track: Track
185
+ * }}
186 186
  */
187 187
 export function trackMutedChanged(track) {
188 188
     return {
@@ -199,7 +199,10 @@ export function trackMutedChanged(track) {
199 199
  * conference.
200 200
  *
201 201
  * @param {(JitsiLocalTrack|JitsiRemoteTrack)} track - JitsiTrack instance.
202
- * @returns {{ type: TRACK_REMOVED, track: Track }}
202
+ * @returns {{
203
+ *     type: TRACK_REMOVED,
204
+ *     track: Track
205
+ * }}
203 206
  */
204 207
 export function trackRemoved(track) {
205 208
     track.removeAllListeners(JitsiTrackEvents.TRACK_MUTE_CHANGED);
@@ -217,7 +220,10 @@ export function trackRemoved(track) {
217 220
  * Signal that track's video started to play.
218 221
  *
219 222
  * @param {(JitsiLocalTrack|JitsiRemoteTrack)} track - JitsiTrack instance.
220
- * @returns {{ type: TRACK_UPDATED, track: Track }}
223
+ * @returns {{
224
+ *     type: TRACK_UPDATED,
225
+ *     track: Track
226
+ * }}
221 227
  */
222 228
 export function trackVideoStarted(track) {
223 229
     return {
@@ -234,7 +240,10 @@ export function trackVideoStarted(track) {
234 240
  *
235 241
  * @param {(JitsiLocalTrack|JitsiRemoteTrack)} track - JitsiTrack instance.
236 242
  * @param {VIDEO_TYPE|undefined} videoType - Video type.
237
- * @returns {{ type: TRACK_UPDATED, track: Track }}
243
+ * @returns {{
244
+ *     type: TRACK_UPDATED,
245
+ *     track: Track
246
+ * }}
238 247
  */
239 248
 export function trackVideoTypeChanged(track, videoType) {
240 249
     return {
@@ -254,8 +263,7 @@ export function trackVideoTypeChanged(track, videoType) {
254 263
  * @returns {Function}
255 264
  */
256 265
 function _addTracks(tracks) {
257
-    return dispatch =>
258
-        Promise.all(tracks.map(t => dispatch(trackAdded(t))));
266
+    return dispatch => Promise.all(tracks.map(t => dispatch(trackAdded(t))));
259 267
 }
260 268
 
261 269
 /**
@@ -311,8 +319,8 @@ function _getLocalTrack(tracks, mediaType) {
311 319
  * tracks.
312 320
  * @private
313 321
  * @returns {{
314
- *      tracksToAdd: JitsiLocalTrack[],
315
- *      tracksToRemove: JitsiLocalTrack[]
322
+ *     tracksToAdd: JitsiLocalTrack[],
323
+ *     tracksToRemove: JitsiLocalTrack[]
316 324
  * }}
317 325
  */
318 326
 function _getLocalTracksToChange(currentTracks, newTracks) {
@@ -363,8 +371,7 @@ function _shouldMirror(track) {
363 371
             // of the value on the right side of the equality check is defined
364 372
             // by jitsi-meet. The type definitions are surely compatible today
365 373
             // but that may not be the case tomorrow.
366
-            && track.getCameraFacingMode() === CAMERA_FACING_MODE.USER
367
-    );
374
+            && track.getCameraFacingMode() === CAMERA_FACING_MODE.USER);
368 375
 }
369 376
 
370 377
 /**

Ładowanie…
Anuluj
Zapisz