Skip to content

Jitsi Meet - Secure, Simple and Scalable Video Conferences that you use as a standalone app or embed in your web application.

fix(remotecontrol): Handle screen sharing cancel

hristoterezov5ef914602f0a
diff --git a/conference.js b/conference.js
index e4297d7f70..df8add4efc 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 f6bab6c594..b4928b3e23 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 ff107acbf6..0adc72b7f6 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'