From 5ef914602f0ab976db51bedc321dbeaf35fbc37d Mon Sep 17 00:00:00 2001 From: hristoterezov Date: Mon, 21 Aug 2017 11:57:58 +0300 Subject: [PATCH] fix(remotecontrol): Handle screen sharing cancel --- conference.js | 4 +++- modules/API/API.js | 4 +++- react/features/toolbox/defaultToolbarButtons.js | 4 +++- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/conference.js b/conference.js index e4297d7f7..df8add4ef 100644 --- a/conference.js +++ b/conference.js @@ -1520,6 +1520,8 @@ export default { // asynchronous, but does not return a Promise and is not part of // the current Promise chain. this._handleScreenSharingError(error); + + return Promise.reject(error); }); }, @@ -1548,7 +1550,7 @@ export default { // again switching to the screen sharing. APP.UI.showExtensionInlineInstallationDialog( () => { - this.toggleScreenSharing(); + this.toggleScreenSharing().catch(() => {}); } ); diff --git a/modules/API/API.js b/modules/API/API.js index f6bab6c59..b4928b3e2 100644 --- a/modules/API/API.js +++ b/modules/API/API.js @@ -131,7 +131,9 @@ function shouldBeEnabled() { */ function toggleScreenSharing() { if (APP.conference.isDesktopSharingEnabled) { - APP.conference.toggleScreenSharing(); + + // eslint-disable-next-line no-empty-function + APP.conference.toggleScreenSharing().catch(() => {}); } else { initialScreenSharingState = !initialScreenSharingState; } diff --git a/react/features/toolbox/defaultToolbarButtons.js b/react/features/toolbox/defaultToolbarButtons.js index ff107acbf..0adc72b7f 100644 --- a/react/features/toolbox/defaultToolbarButtons.js +++ b/react/features/toolbox/defaultToolbarButtons.js @@ -153,7 +153,9 @@ const buttons: Object = { shortcutAttr: 'toggleDesktopSharingPopover', shortcutFunc() { JitsiMeetJS.analytics.sendEvent('shortcut.screen.toggled'); - APP.conference.toggleScreenSharing(); + + // eslint-disable-next-line no-empty-function + APP.conference.toggleScreenSharing().catch(() => {}); }, shortcutDescription: 'keyboardShortcuts.toggleScreensharing', tooltipKey: 'toolbar.sharescreen'