fix(remotecontrol): Handle screen sharing cancel

This commit is contained in:
hristoterezov 2017-08-21 11:57:58 +03:00 committed by Paweł Domas
parent 2818520c8f
commit 5ef914602f
3 changed files with 9 additions and 3 deletions

View File

@ -1520,6 +1520,8 @@ export default {
// asynchronous, but does not return a Promise and is not part of // asynchronous, but does not return a Promise and is not part of
// the current Promise chain. // the current Promise chain.
this._handleScreenSharingError(error); this._handleScreenSharingError(error);
return Promise.reject(error);
}); });
}, },
@ -1548,7 +1550,7 @@ export default {
// again switching to the screen sharing. // again switching to the screen sharing.
APP.UI.showExtensionInlineInstallationDialog( APP.UI.showExtensionInlineInstallationDialog(
() => { () => {
this.toggleScreenSharing(); this.toggleScreenSharing().catch(() => {});
} }
); );

View File

@ -131,7 +131,9 @@ function shouldBeEnabled() {
*/ */
function toggleScreenSharing() { function toggleScreenSharing() {
if (APP.conference.isDesktopSharingEnabled) { if (APP.conference.isDesktopSharingEnabled) {
APP.conference.toggleScreenSharing();
// eslint-disable-next-line no-empty-function
APP.conference.toggleScreenSharing().catch(() => {});
} else { } else {
initialScreenSharingState = !initialScreenSharingState; initialScreenSharingState = !initialScreenSharingState;
} }

View File

@ -153,7 +153,9 @@ const buttons: Object = {
shortcutAttr: 'toggleDesktopSharingPopover', shortcutAttr: 'toggleDesktopSharingPopover',
shortcutFunc() { shortcutFunc() {
JitsiMeetJS.analytics.sendEvent('shortcut.screen.toggled'); JitsiMeetJS.analytics.sendEvent('shortcut.screen.toggled');
APP.conference.toggleScreenSharing();
// eslint-disable-next-line no-empty-function
APP.conference.toggleScreenSharing().catch(() => {});
}, },
shortcutDescription: 'keyboardShortcuts.toggleScreensharing', shortcutDescription: 'keyboardShortcuts.toggleScreensharing',
tooltipKey: 'toolbar.sharescreen' tooltipKey: 'toolbar.sharescreen'