Browse Source
Merge pull request #2950 from nextcloud/bugfix/noid/await-the-leave-call-before-leaving-the-conversation
Await that the call was left before leaving the conversation
pull/2955/head
Ivan Sein
6 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
18 additions and
17 deletions
-
src/utils/signaling.js
|
|
|
@ -250,24 +250,25 @@ Signaling.Base.prototype._leaveRoomSuccess = function(/* token */) { |
|
|
|
|
|
|
|
Signaling.Base.prototype.leaveRoom = function(token) { |
|
|
|
this.leaveCurrentCall() |
|
|
|
|
|
|
|
this._trigger('leaveRoom', [token]) |
|
|
|
this._doLeaveRoom(token) |
|
|
|
|
|
|
|
return new Promise((resolve, reject) => { |
|
|
|
axios.delete(generateOcsUrl('apps/spreed/api/v1/room', 2) + token + '/participants/active') |
|
|
|
.then(function() { |
|
|
|
this._leaveRoomSuccess(token) |
|
|
|
resolve() |
|
|
|
// We left the current room.
|
|
|
|
if (token === this.currentRoomToken) { |
|
|
|
this.currentRoomToken = null |
|
|
|
} |
|
|
|
}.bind(this)) |
|
|
|
.catch(function() { |
|
|
|
reject(new Error()) |
|
|
|
.then(() => { |
|
|
|
this._trigger('leaveRoom', [token]) |
|
|
|
this._doLeaveRoom(token) |
|
|
|
|
|
|
|
return new Promise((resolve, reject) => { |
|
|
|
axios.delete(generateOcsUrl('apps/spreed/api/v1/room', 2) + token + '/participants/active') |
|
|
|
.then(function() { |
|
|
|
this._leaveRoomSuccess(token) |
|
|
|
resolve() |
|
|
|
// We left the current room.
|
|
|
|
if (token === this.currentRoomToken) { |
|
|
|
this.currentRoomToken = null |
|
|
|
} |
|
|
|
}.bind(this)) |
|
|
|
.catch(function() { |
|
|
|
reject(new Error()) |
|
|
|
}) |
|
|
|
}) |
|
|
|
}) |
|
|
|
}) |
|
|
|
} |
|
|
|
|
|
|
|
Signaling.Base.prototype.getSendVideoIfAvailable = function() { |
|
|
|
|