Przeglądaj źródła

fix(conference): API left event.

master
Hristo Terezov 6 lat temu
rodzic
commit
d01cfc8466
1 zmienionych plików z 7 dodań i 5 usunięć
  1. 7
    5
      conference.js

+ 7
- 5
conference.js Wyświetl plik

@@ -488,10 +488,13 @@ class ConferenceConnector {
488 488
  * call in hangup() to resolve when all operations are finished.
489 489
  */
490 490
 function disconnect() {
491
-    connection.disconnect();
492
-    APP.API.notifyConferenceLeft(APP.conference.roomName);
491
+    const onDisconnected = () => {
492
+        APP.API.notifyConferenceLeft(APP.conference.roomName);
493 493
 
494
-    return Promise.resolve();
494
+        return Promise.resolve();
495
+    };
496
+
497
+    return connection.disconnect().then(onDisconnected, onDisconnected);
495 498
 }
496 499
 
497 500
 /**
@@ -2603,8 +2606,7 @@ export default {
2603 2606
     leaveRoomAndDisconnect() {
2604 2607
         APP.store.dispatch(conferenceWillLeave(room));
2605 2608
 
2606
-        return room.leave()
2607
-            .then(disconnect, disconnect);
2609
+        return room.leave().then(disconnect, disconnect);
2608 2610
     },
2609 2611
 
2610 2612
     /**

Ładowanie…
Anuluj
Zapisz