소스 검색

Minor fixes for error dialogs

j8
tsareg 9 년 전
부모
커밋
ccdba03888
2개의 변경된 파일25개의 추가작업 그리고 16개의 파일을 삭제
  1. 0
    2
      conference.js
  2. 25
    14
      modules/UI/UI.js

+ 0
- 2
conference.js 파일 보기

1056
                 this.useVideoStream(null);
1056
                 this.useVideoStream(null);
1057
                 this.videoSwitchInProgress = false;
1057
                 this.videoSwitchInProgress = false;
1058
                 console.error('failed to share local video', err);
1058
                 console.error('failed to share local video', err);
1059
-
1060
-                APP.UI.showDeviceErrorDialog('camera', err);
1061
             });
1059
             });
1062
         }
1060
         }
1063
     },
1061
     },

+ 25
- 14
modules/UI/UI.js 파일 보기

1164
         throw new Error("Invalid device type");
1164
         throw new Error("Invalid device type");
1165
     }
1165
     }
1166
 
1166
 
1167
-    if (window.localStorage[type + "DoNotShowErrorAgain-" + error.name]
1168
-        === "true") {
1167
+    if (error.name && error instanceof JitsiMeetJS.JitsiTrackError &&
1168
+        window.localStorage[type + "DoNotShowErrorAgain-" + error.name]
1169
+            === "true") {
1169
         return;
1170
         return;
1170
     }
1171
     }
1171
 
1172
 
1172
     let titleKey = error.name === TrackErrors.PERMISSION_DENIED
1173
     let titleKey = error.name === TrackErrors.PERMISSION_DENIED
1173
             ? "dialog.permissionDenied"
1174
             ? "dialog.permissionDenied"
1174
             : "dialog.error",
1175
             : "dialog.error",
1175
-        errorMsg = JITSI_TRACK_ERROR_TO_MESSAGE_KEY_MAP[type][error.name],
1176
-        doNotShowAgainMsg = "dialog.doNotShowWarningAgain",
1176
+        errorMsg = JITSI_TRACK_ERROR_TO_MESSAGE_KEY_MAP[type][error.name] ||
1177
+            JITSI_TRACK_ERROR_TO_MESSAGE_KEY_MAP[type][TrackErrors.GENERAL],
1177
         title = `<span data-i18n="${titleKey}"></span>`,
1178
         title = `<span data-i18n="${titleKey}"></span>`,
1178
-        message = `
1179
-            <h4 data-i18n="${errorMsg}"></h4>
1180
-            <label>
1181
-                <input type="checkbox" id="doNotShowWarningAgain">
1182
-                <span data-i18n="${doNotShowAgainMsg}"></span>
1183
-            </label>`;
1179
+        message = "<h4 data-i18n='" + errorMsg + "'></h4>" +
1180
+            (!JITSI_TRACK_ERROR_TO_MESSAGE_KEY_MAP[type][error.name]
1181
+            && error.message
1182
+                ? "<div>" + error.message + "</div>"
1183
+                : "") +
1184
+            "<label>" +
1185
+                "<input type='checkbox' id='doNotShowWarningAgain'> " +
1186
+                (error instanceof JitsiMeetJS.JitsiTrackError && error.name
1187
+                    ? "<span data-i18n='dialog.doNotShowWarningAgain'></span>"
1188
+                    : "") +
1189
+            "</label>";
1184
 
1190
 
1185
     messageHandler.openDialog(
1191
     messageHandler.openDialog(
1186
         title,
1192
         title,
1188
         false,
1194
         false,
1189
         {Ok: true},
1195
         {Ok: true},
1190
         function () {
1196
         function () {
1191
-            let form  = $.prompt.getPrompt(),
1192
-                input = form.find("#doNotShowWarningAgain");
1197
+            let form  = $.prompt.getPrompt();
1198
+
1199
+            if (form) {
1200
+                let input = form.find("#doNotShowWarningAgain");
1193
 
1201
 
1194
-            window.localStorage[type + "DoNotShowErrorAgain-" + error.name]
1195
-                = input.prop("checked");
1202
+                if (input.length) {
1203
+                    window.localStorage[type + "DoNotShowErrorAgain-"
1204
+                        + error.name] = input.prop("checked");
1205
+                }
1206
+            }
1196
         }
1207
         }
1197
     );
1208
     );
1198
 
1209
 

Loading…
취소
저장