瀏覽代碼

Use functions, do not re-implement them

We have the functions reload and redirect which modify window.location.
Use them and do not directly modify window.location so that we have
fewer places of direct window.location modifications and it is easier to
refactor them.
j8
Lyubomir Marinov 8 年之前
父節點
當前提交
d6b0f8d4c5
共有 1 個文件被更改,包括 3 次插入3 次删除
  1. 3
    3
      conference.js

+ 3
- 3
conference.js 查看文件

@@ -10,7 +10,7 @@ import Recorder from './modules/recorder/Recorder';
10 10
 
11 11
 import mediaDeviceHelper from './modules/devices/mediaDeviceHelper';
12 12
 
13
-import {reportError} from './modules/util/helpers';
13
+import { reload, reportError } from './modules/util/helpers';
14 14
 
15 15
 import UIEvents from './service/UI/UIEvents';
16 16
 import UIUtil from './modules/UI/util/UIUtil';
@@ -417,7 +417,7 @@ class ConferenceConnector {
417 417
             APP.UI.notifyMaxUsersLimitReached();
418 418
             break;
419 419
         case ConferenceErrors.INCOMPATIBLE_SERVER_VERSIONS:
420
-            window.location.reload();
420
+            reload();
421 421
             break;
422 422
         default:
423 423
             this._handleConferenceFailed(err, ...params);
@@ -1474,7 +1474,7 @@ export default {
1474 1474
         APP.UI.addListener(UIEvents.LOGOUT, () => {
1475 1475
             AuthHandler.logout(room).then(url => {
1476 1476
                 if (url) {
1477
-                    window.location.href = url;
1477
+                    UIUtil.redirect(url);
1478 1478
                 } else {
1479 1479
                     this.hangup(true);
1480 1480
                 }

Loading…
取消
儲存