Selaa lähdekoodia

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 vuotta sitten
vanhempi
commit
d6b0f8d4c5
1 muutettua tiedostoa jossa 3 lisäystä ja 3 poistoa
  1. 3
    3
      conference.js

+ 3
- 3
conference.js Näytä tiedosto

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

Loading…
Peruuta
Tallenna