Browse Source

fix(conference): API left event.

master
Hristo Terezov 6 years ago
parent
commit
d01cfc8466
1 changed files with 7 additions and 5 deletions
  1. 7
    5
      conference.js

+ 7
- 5
conference.js View File

488
  * call in hangup() to resolve when all operations are finished.
488
  * call in hangup() to resolve when all operations are finished.
489
  */
489
  */
490
 function disconnect() {
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
     leaveRoomAndDisconnect() {
2606
     leaveRoomAndDisconnect() {
2604
         APP.store.dispatch(conferenceWillLeave(room));
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
     /**

Loading…
Cancel
Save