Fix typos. Apply consistent formatting

This commit is contained in:
Lyubo Marinov 2017-07-18 16:43:58 -05:00
parent a690b9d5e1
commit b62b296080
2 changed files with 53 additions and 55 deletions

View File

@ -1256,21 +1256,20 @@ export default {
devices: ['desktop'], devices: ['desktop'],
desktopSharingExtensionExternalInstallation: { desktopSharingExtensionExternalInstallation: {
interval: 500, interval: 500,
checkAgain: () => { checkAgain: () => DSExternalInstallationInProgress,
return DSExternalInstallationInProgress;
},
listener: (status, url) => { listener: (status, url) => {
switch(status) { switch(status) {
case "waitingForExtension": { case "waitingForExtension": {
DSExternalInstallationInProgress = true; DSExternalInstallationInProgress = true;
externalInstallation = true; externalInstallation = true;
const listener = () => { const listener = () => {
// Wait a little bit more just to be sure that // Wait a little bit more just to be sure that we
// we won't miss the extension installation // won't miss the extension installation
setTimeout( setTimeout(
() => { () => {
DSExternalInstallationInProgress = false; DSExternalInstallationInProgress = false;
}, 500); },
500);
APP.UI.removeListener( APP.UI.removeListener(
UIEvents.EXTERNAL_INSTALLATION_CANCELED, UIEvents.EXTERNAL_INSTALLATION_CANCELED,
listener); listener);
@ -1281,15 +1280,12 @@ export default {
APP.UI.showExtensionExternalInstallationDialog(url); APP.UI.showExtensionExternalInstallationDialog(url);
break; break;
} }
case "extensionFound": { case "extensionFound":
if (externalInstallation) { //close the dialog // Close the dialog.
$.prompt.close(); externalInstallation && $.prompt.close();
}
break; break;
} default:
default: { // Unknown status
//Unknown status
}
} }
} }
} }
@ -1304,23 +1300,18 @@ export default {
() => { () => {
// If the stream was stopped during screen sharing // If the stream was stopped during screen sharing
// session then we should switch back to video. // session then we should switch back to video.
if (this.isSharingScreen) { this.isSharingScreen
this._untoggleScreenSharing && this._untoggleScreenSharing
&& this._untoggleScreenSharing(); && this._untoggleScreenSharing();
} }
}
); );
// close external installation dialog on success. // close external installation dialog on success.
if (externalInstallation) { externalInstallation && $.prompt.close();
$.prompt.close();
}
return desktopStream; return desktopStream;
}, error => { }, error => {
DSExternalInstallationInProgress = false; DSExternalInstallationInProgress = false;
// close external installation dialog on success. // close external installation dialog on success.
if (externalInstallation) { externalInstallation && $.prompt.close();
$.prompt.close();
}
throw error; throw error;
}); });
}, },

View File

@ -1,7 +1,4 @@
import JitsiMeetJS, { import { JitsiTrackErrors, JitsiTrackEvents } from '../lib-jitsi-meet';
JitsiTrackErrors,
JitsiTrackEvents
} from '../lib-jitsi-meet';
import { import {
CAMERA_FACING_MODE, CAMERA_FACING_MODE,
MEDIA_TYPE, MEDIA_TYPE,
@ -78,13 +75,13 @@ export function destroyLocalTracks() {
/** /**
* Replaces one track with another for one renegotiation instead of invoking * Replaces one track with another for one renegotiation instead of invoking
* two renegotations with a separate removeTrack and addTrack. Disposes the * two renegotiations with a separate removeTrack and addTrack. Disposes the
* removed track as well. * removed track as well.
* *
* @param {JitsiLocalTrack|null} oldTrack - The track to dispose. * @param {JitsiLocalTrack|null} oldTrack - The track to dispose.
* @param {JitsiLocalTrack|null} newTrack - The track to use instead. * @param {JitsiLocalTrack|null} newTrack - The track to use instead.
* @param {JitsiConference} [conference] - The conference from which to remove * @param {JitsiConference} [conference] - The conference from which to remove
* and add the tracks. If one is not provied, the conference in the redux store * and add the tracks. If one is not provided, the conference in the redux store
* will be used. * will be used.
* @returns {Function} * @returns {Function}
*/ */
@ -182,7 +179,10 @@ export function trackAdded(track) {
* changed. * changed.
* *
* @param {(JitsiLocalTrack|JitsiRemoteTrack)} track - JitsiTrack instance. * @param {(JitsiLocalTrack|JitsiRemoteTrack)} track - JitsiTrack instance.
* @returns {{ type: TRACK_UPDATED, track: Track }} * @returns {{
* type: TRACK_UPDATED,
* track: Track
* }}
*/ */
export function trackMutedChanged(track) { export function trackMutedChanged(track) {
return { return {
@ -199,7 +199,10 @@ export function trackMutedChanged(track) {
* conference. * conference.
* *
* @param {(JitsiLocalTrack|JitsiRemoteTrack)} track - JitsiTrack instance. * @param {(JitsiLocalTrack|JitsiRemoteTrack)} track - JitsiTrack instance.
* @returns {{ type: TRACK_REMOVED, track: Track }} * @returns {{
* type: TRACK_REMOVED,
* track: Track
* }}
*/ */
export function trackRemoved(track) { export function trackRemoved(track) {
track.removeAllListeners(JitsiTrackEvents.TRACK_MUTE_CHANGED); track.removeAllListeners(JitsiTrackEvents.TRACK_MUTE_CHANGED);
@ -217,7 +220,10 @@ export function trackRemoved(track) {
* Signal that track's video started to play. * Signal that track's video started to play.
* *
* @param {(JitsiLocalTrack|JitsiRemoteTrack)} track - JitsiTrack instance. * @param {(JitsiLocalTrack|JitsiRemoteTrack)} track - JitsiTrack instance.
* @returns {{ type: TRACK_UPDATED, track: Track }} * @returns {{
* type: TRACK_UPDATED,
* track: Track
* }}
*/ */
export function trackVideoStarted(track) { export function trackVideoStarted(track) {
return { return {
@ -234,7 +240,10 @@ export function trackVideoStarted(track) {
* *
* @param {(JitsiLocalTrack|JitsiRemoteTrack)} track - JitsiTrack instance. * @param {(JitsiLocalTrack|JitsiRemoteTrack)} track - JitsiTrack instance.
* @param {VIDEO_TYPE|undefined} videoType - Video type. * @param {VIDEO_TYPE|undefined} videoType - Video type.
* @returns {{ type: TRACK_UPDATED, track: Track }} * @returns {{
* type: TRACK_UPDATED,
* track: Track
* }}
*/ */
export function trackVideoTypeChanged(track, videoType) { export function trackVideoTypeChanged(track, videoType) {
return { return {
@ -254,8 +263,7 @@ export function trackVideoTypeChanged(track, videoType) {
* @returns {Function} * @returns {Function}
*/ */
function _addTracks(tracks) { function _addTracks(tracks) {
return dispatch => return dispatch => Promise.all(tracks.map(t => dispatch(trackAdded(t))));
Promise.all(tracks.map(t => dispatch(trackAdded(t))));
} }
/** /**
@ -363,8 +371,7 @@ function _shouldMirror(track) {
// of the value on the right side of the equality check is defined // of the value on the right side of the equality check is defined
// by jitsi-meet. The type definitions are surely compatible today // by jitsi-meet. The type definitions are surely compatible today
// but that may not be the case tomorrow. // but that may not be the case tomorrow.
&& track.getCameraFacingMode() === CAMERA_FACING_MODE.USER && track.getCameraFacingMode() === CAMERA_FACING_MODE.USER);
);
} }
/** /**