Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 4 additions & 9 deletions src/services/participantsService.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,16 +66,11 @@ async function rejoinConversation(token) {
* @param {string} token The conversation token;
*/
async function leaveConversation(token) {
try {
// FIXME Signaling should not be synchronous
await signalingLeaveConversation(token)
// FIXME Signaling should not be synchronous
await signalingLeaveConversation(token)

const response = await axios.delete(generateOcsUrl('apps/spreed/api/v4/room/{token}/participants/active', { token }))
return response
} catch (error) {
console.debug(error)
// FIXME: should throw
}
const response = await axios.delete(generateOcsUrl('apps/spreed/api/v4/room/{token}/participants/active', { token }))
return response
}

/**
Expand Down
14 changes: 9 additions & 5 deletions src/store/participantsStore.js
Original file line number Diff line number Diff line change
Expand Up @@ -1099,10 +1099,6 @@ const actions = {
* @param {string} data.token - conversation token.
*/
async leaveConversation(context, { token }) {
if (SessionStorage.getItem('joined_conversation') === token) {
// Drop token from SessionStorage to not consider a room joined anymore
SessionStorage.removeItem('joined_conversation')
}
const actorStore = useActorStore()
if (context.getters.isInCall(token)) {
await context.dispatch('leaveCall', {
Expand All @@ -1111,7 +1107,15 @@ const actions = {
})
}

await leaveConversation(token)
try {
await leaveConversation(token)
if (SessionStorage.getItem('joined_conversation') === token) {
// Drop token from SessionStorage to not consider a room joined anymore
SessionStorage.removeItem('joined_conversation')
}
} catch (error) {
console.error('Error while leaving conversation:', error)
}
},

/**
Expand Down
Loading