Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/spreed.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDaniel Calviño Sánchez <danxuliu@gmail.com>2019-12-31 16:06:19 +0300
committerDaniel Calviño Sánchez <danxuliu@gmail.com>2020-01-09 15:43:08 +0300
commit944c5e5cc9ef9da492ab626b98cfd7c6ce0211c7 (patch)
treeec5614d11aa90c31e3aa12cffda580c88c5cb715 /src
parentb276e058a95cffff7be6d04f4c420a8e913a9f26 (diff)
Fix join/leaveConversation not waiting until the action is done
join/leaveConversation are marked as asynchronous, so it is expected that invoking them with await will wait until the conversation is joined or left before continuing. Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
Diffstat (limited to 'src')
-rw-r--r--src/services/participantsService.js9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/services/participantsService.js b/src/services/participantsService.js
index a63c93dcf..6c1906352 100644
--- a/src/services/participantsService.js
+++ b/src/services/participantsService.js
@@ -35,9 +35,9 @@ const joinConversation = async(token) => {
try {
const signaling = await getSignaling()
- signaling.joinRoom(token).then(() => {
- EventBus.$emit('joinedConversation')
- })
+ await signaling.joinRoom(token)
+
+ EventBus.$emit('joinedConversation')
// FIXME Signaling should not handle joining a conversation
// const response = await axios.post(generateOcsUrl('apps/spreed/api/v1', 2) + `room/${token}/participants/active`)
@@ -56,7 +56,8 @@ const leaveConversation = async function(token) {
try {
const signaling = await getSignaling()
- signaling.leaveRoom(token)
+ await signaling.leaveRoom(token)
+
// FIXME Signaling should not handle leaving a conversation
// const response = await axios.delete(generateOcsUrl('apps/spreed/api/v1', 2) + `room/${token}/participants/active`)
// return response