Skip to content

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

Minor fixes for error dialogs

tsaregccdba038889c
diff --git a/conference.js b/conference.js
index c2de11ff32..09d33d0115 100644
--- a/conference.js
+++ b/conference.js
@@ -1056,8 +1056,6 @@ export default {
this.useVideoStream(null);
this.videoSwitchInProgress = false;
console.error('failed to share local video', err);
-
- APP.UI.showDeviceErrorDialog('camera', err);
});
}
},
diff --git a/modules/UI/UI.js b/modules/UI/UI.js
index 89e1589d00..40b12180df 100644
--- a/modules/UI/UI.js
+++ b/modules/UI/UI.js
@@ -1164,23 +1164,29 @@ UI.showDeviceErrorDialog = function (type, error) {
throw new Error("Invalid device type");
}
- if (window.localStorage[type + "DoNotShowErrorAgain-" + error.name]
- === "true") {
+ if (error.name && error instanceof JitsiMeetJS.JitsiTrackError &&
+ window.localStorage[type + "DoNotShowErrorAgain-" + error.name]
+ === "true") {
return;
}
let titleKey = error.name === TrackErrors.PERMISSION_DENIED
? "dialog.permissionDenied"
: "dialog.error",
- errorMsg = JITSI_TRACK_ERROR_TO_MESSAGE_KEY_MAP[type][error.name],
- doNotShowAgainMsg = "dialog.doNotShowWarningAgain",
+ errorMsg = JITSI_TRACK_ERROR_TO_MESSAGE_KEY_MAP[type][error.name] ||
+ JITSI_TRACK_ERROR_TO_MESSAGE_KEY_MAP[type][TrackErrors.GENERAL],
title = `<span data-i18n="${titleKey}"></span>`,
- message = `
- <h4 data-i18n="${errorMsg}"></h4>
- <label>
- <input type="checkbox" id="doNotShowWarningAgain">
- <span data-i18n="${doNotShowAgainMsg}"></span>
- </label>`;
+ message = "<h4 data-i18n='" + errorMsg + "'></h4>" +
+ (!JITSI_TRACK_ERROR_TO_MESSAGE_KEY_MAP[type][error.name]
+ && error.message
+ ? "<div>" + error.message + "</div>"
+ : "") +
+ "<label>" +
+ "<input type='checkbox' id='doNotShowWarningAgain'> " +
+ (error instanceof JitsiMeetJS.JitsiTrackError && error.name
+ ? "<span data-i18n='dialog.doNotShowWarningAgain'></span>"
+ : "") +
+ "</label>";
messageHandler.openDialog(
title,
@@ -1188,11 +1194,16 @@ UI.showDeviceErrorDialog = function (type, error) {
false,
{Ok: true},
function () {
- let form = $.prompt.getPrompt(),
- input = form.find("#doNotShowWarningAgain");
+ let form = $.prompt.getPrompt();
+
+ if (form) {
+ let input = form.find("#doNotShowWarningAgain");
- window.localStorage[type + "DoNotShowErrorAgain-" + error.name]
- = input.prop("checked");
+ if (input.length) {
+ window.localStorage[type + "DoNotShowErrorAgain-"
+ + error.name] = input.prop("checked");
+ }
+ }
}
);