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

View File

@ -1,7 +1,4 @@
import JitsiMeetJS, {
JitsiTrackErrors,
JitsiTrackEvents
} from '../lib-jitsi-meet';
import { JitsiTrackErrors, JitsiTrackEvents } from '../lib-jitsi-meet';
import {
CAMERA_FACING_MODE,
MEDIA_TYPE,
@ -78,13 +75,13 @@ export function destroyLocalTracks() {
/**
* 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.
*
* @param {JitsiLocalTrack|null} oldTrack - The track to dispose.
* @param {JitsiLocalTrack|null} newTrack - The track to use instead.
* @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.
* @returns {Function}
*/
@ -182,7 +179,10 @@ export function trackAdded(track) {
* changed.
*
* @param {(JitsiLocalTrack|JitsiRemoteTrack)} track - JitsiTrack instance.
* @returns {{ type: TRACK_UPDATED, track: Track }}
* @returns {{
* type: TRACK_UPDATED,
* track: Track
* }}
*/
export function trackMutedChanged(track) {
return {
@ -199,7 +199,10 @@ export function trackMutedChanged(track) {
* conference.
*
* @param {(JitsiLocalTrack|JitsiRemoteTrack)} track - JitsiTrack instance.
* @returns {{ type: TRACK_REMOVED, track: Track }}
* @returns {{
* type: TRACK_REMOVED,
* track: Track
* }}
*/
export function trackRemoved(track) {
track.removeAllListeners(JitsiTrackEvents.TRACK_MUTE_CHANGED);
@ -217,7 +220,10 @@ export function trackRemoved(track) {
* Signal that track's video started to play.
*
* @param {(JitsiLocalTrack|JitsiRemoteTrack)} track - JitsiTrack instance.
* @returns {{ type: TRACK_UPDATED, track: Track }}
* @returns {{
* type: TRACK_UPDATED,
* track: Track
* }}
*/
export function trackVideoStarted(track) {
return {
@ -234,7 +240,10 @@ export function trackVideoStarted(track) {
*
* @param {(JitsiLocalTrack|JitsiRemoteTrack)} track - JitsiTrack instance.
* @param {VIDEO_TYPE|undefined} videoType - Video type.
* @returns {{ type: TRACK_UPDATED, track: Track }}
* @returns {{
* type: TRACK_UPDATED,
* track: Track
* }}
*/
export function trackVideoTypeChanged(track, videoType) {
return {
@ -254,8 +263,7 @@ export function trackVideoTypeChanged(track, videoType) {
* @returns {Function}
*/
function _addTracks(tracks) {
return dispatch =>
Promise.all(tracks.map(t => dispatch(trackAdded(t))));
return dispatch => Promise.all(tracks.map(t => dispatch(trackAdded(t))));
}
/**
@ -311,8 +319,8 @@ function _getLocalTrack(tracks, mediaType) {
* tracks.
* @private
* @returns {{
* tracksToAdd: JitsiLocalTrack[],
* tracksToRemove: JitsiLocalTrack[]
* tracksToAdd: JitsiLocalTrack[],
* tracksToRemove: JitsiLocalTrack[]
* }}
*/
function _getLocalTracksToChange(currentTracks, newTracks) {
@ -363,8 +371,7 @@ function _shouldMirror(track) {
// of the value on the right side of the equality check is defined
// by jitsi-meet. The type definitions are surely compatible today
// but that may not be the case tomorrow.
&& track.getCameraFacingMode() === CAMERA_FACING_MODE.USER
);
&& track.getCameraFacingMode() === CAMERA_FACING_MODE.USER);
}
/**