瀏覽代碼

Merge pull request #489 from isymchych/handle-focus-left

handle FOCUS_LEFT conference error
master
Paweł Domas 9 年之前
父節點
當前提交
ff4de4cb5b
共有 4 個文件被更改,包括 41 次插入6 次删除
  1. 5
    1
      conference.js
  2. 1
    0
      lang/main.json
  3. 28
    5
      modules/UI/UI.js
  4. 7
    0
      modules/util/helpers.js

+ 5
- 1
conference.js 查看文件

@@ -146,7 +146,7 @@ class ConferenceConnector {
146 146
             break;
147 147
 
148 148
         case ConferenceErrors.GRACEFUL_SHUTDOWN:
149
-            APP.UI.notifyGracefulShudown();
149
+            APP.UI.notifyGracefulShutdown();
150 150
             break;
151 151
 
152 152
         case ConferenceErrors.JINGLE_FATAL_ERROR:
@@ -168,6 +168,10 @@ class ConferenceConnector {
168 168
             }
169 169
             break;
170 170
 
171
+        case ConferenceErrors.FOCUS_LEFT:
172
+            APP.UI.notifyFocusLeft();
173
+            break;
174
+
171 175
         default:
172 176
             this._handleConferenceFailed(err, ...params);
173 177
         }

+ 1
- 0
lang/main.json 查看文件

@@ -143,6 +143,7 @@
143 143
         "failtoinstall": "Failed to install desktop sharing extension",
144 144
         "failedpermissions": "Failed to obtain permissions to use the local microphone and/or camera.",
145 145
         "bridgeUnavailable": "Jitsi Videobridge is currently unavailable. Please try again later!",
146
+        "jicofoUnavailable": "Jicofo is currently unavailable. Please try again later!",
146 147
         "lockTitle": "Lock failed",
147 148
         "lockMessage": "Failed to lock the conference.",
148 149
         "warning": "Warning",

+ 28
- 5
modules/UI/UI.js 查看文件

@@ -18,6 +18,7 @@ import EtherpadManager from './etherpad/Etherpad';
18 18
 import VideoLayout from "./videolayout/VideoLayout";
19 19
 import SettingsMenu from "./side_pannels/settings/SettingsMenu";
20 20
 import Settings from "./../settings/Settings";
21
+import { reload } from '../util/helpers';
21 22
 
22 23
 var EventEmitter = require("events");
23 24
 UI.messageHandler = require("./util/MessageHandler");
@@ -136,7 +137,7 @@ function toggleFullScreen () {
136 137
 /**
137 138
  * Notify user that server has shut down.
138 139
  */
139
-UI.notifyGracefulShudown = function () {
140
+UI.notifyGracefulShutdown = function () {
140 141
     messageHandler.openMessageDialog(
141 142
         'dialog.serviceUnavailable',
142 143
         'dialog.gracefulShutdown'
@@ -635,7 +636,7 @@ UI.showLoginPopup = function(callback) {
635 636
         '<input name="password" ' +
636 637
         'type="password" data-i18n="[placeholder]dialog.userPassword"' +
637 638
         ' placeholder="user password">';
638
-    UI.messageHandler.openTwoButtonDialog(null, null, null, message,
639
+    messageHandler.openTwoButtonDialog(null, null, null, message,
639 640
         true,
640 641
         "dialog.Ok",
641 642
         function (e, v, m, f) {
@@ -965,17 +966,39 @@ UI.notifyTokenAuthFailed = function () {
965 966
 };
966 967
 
967 968
 UI.notifyInternalError = function () {
968
-    UI.messageHandler.showError("dialog.sorry", "dialog.internalError");
969
+    messageHandler.showError("dialog.sorry", "dialog.internalError");
969 970
 };
970 971
 
971 972
 UI.notifyFocusDisconnected = function (focus, retrySec) {
972
-    UI.messageHandler.notify(
973
+    messageHandler.notify(
973 974
         null, "notify.focus",
974 975
         'disconnected', "notify.focusFail",
975 976
         {component: focus, ms: retrySec}
976 977
     );
977 978
 };
978 979
 
980
+/**
981
+ * Notify user that focus left the conference so page should be reloaded.
982
+ */
983
+UI.notifyFocusLeft = function () {
984
+    let title = APP.translation.generateTranslationHTML(
985
+        'dialog.serviceUnavailable'
986
+    );
987
+    let msg = APP.translation.generateTranslationHTML(
988
+        'dialog.jicofoUnavailable'
989
+    );
990
+    messageHandler.openDialog(
991
+        title,
992
+        msg,
993
+        true, // persistent
994
+        [{title: 'retry'}],
995
+        function () {
996
+            reload();
997
+            return false;
998
+        }
999
+    );
1000
+};
1001
+
979 1002
 /**
980 1003
  * Updates auth info on the UI.
981 1004
  * @param {boolean} isAuthEnabled if authentication is enabled
@@ -1030,7 +1053,7 @@ UI.getLargeVideoID = function () {
1030 1053
  * Shows dialog with a link to FF extension.
1031 1054
  */
1032 1055
 UI.showExtensionRequiredDialog = function (url) {
1033
-    APP.UI.messageHandler.openMessageDialog(
1056
+    messageHandler.openMessageDialog(
1034 1057
         "dialog.extensionRequired",
1035 1058
         null,
1036 1059
         null,

+ 7
- 0
modules/util/helpers.js 查看文件

@@ -12,3 +12,10 @@ export function createDeferred () {
12 12
 
13 13
     return deferred;
14 14
 }
15
+
16
+/**
17
+ * Reload page.
18
+ */
19
+export function reload () {
20
+    window.location.reload();
21
+}

Loading…
取消
儲存