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
1 change: 1 addition & 0 deletions src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,7 @@ export default {
window.addEventListener('unload', () => {
console.info('Navigating away, leaving conversation')
if (this.token) {
SessionStorage.removeItem('joined_conversation')
// We have to do this synchronously, because in unload and beforeunload
// Promises, async and await are prohibited.
signalingKill()
Expand Down
2 changes: 2 additions & 0 deletions src/FilesSidebarTabApp.vue
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ import { getFileConversation } from './services/filesIntegrationServices.ts'
import {
leaveConversationSync,
} from './services/participantsService.js'
import SessionStorage from './services/SessionStorage.js'
import { useActorStore } from './stores/actor.ts'
import { useTokenStore } from './stores/token.ts'
import { checkBrowser } from './utils/browserCheck.ts'
Expand Down Expand Up @@ -182,6 +183,7 @@ export default {
window.addEventListener('unload', () => {
console.info('Navigating away, leaving conversation')
if (this.token) {
SessionStorage.removeItem('joined_conversation')
// We have to do this synchronously, because in unload and beforeunload
// Promises, async and await are prohibited.
signalingKill()
Expand Down
2 changes: 2 additions & 0 deletions src/PublicShareAuthSidebar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ import {
leaveConversationSync,
setGuestUserName,
} from './services/participantsService.js'
import SessionStorage from './services/SessionStorage.js'
import { useActorStore } from './stores/actor.ts'
import { useTokenStore } from './stores/token.ts'
import { signalingKill } from './utils/webrtc/index.js'
Expand Down Expand Up @@ -115,6 +116,7 @@ export default {
window.addEventListener('unload', () => {
console.info('Navigating away, leaving conversation')
if (this.token) {
SessionStorage.removeItem('joined_conversation')
// We have to do this synchronously, because in unload and beforeunload
// Promises, async and await are prohibited.
signalingKill()
Expand Down
2 changes: 2 additions & 0 deletions src/PublicShareSidebar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ import { getPublicShareConversationData } from './services/filesIntegrationServi
import {
leaveConversationSync,
} from './services/participantsService.js'
import SessionStorage from './services/SessionStorage.js'
import { useActorStore } from './stores/actor.ts'
import { useTokenStore } from './stores/token.ts'
import { checkBrowser } from './utils/browserCheck.ts'
Expand Down Expand Up @@ -142,6 +143,7 @@ export default {
beforeMount() {
window.addEventListener('unload', () => {
if (this.token) {
SessionStorage.removeItem('joined_conversation')
// We have to do this synchronously, because in unload and beforeunload
// Promises, async and await are prohibited.
signalingKill()
Expand Down
2 changes: 2 additions & 0 deletions src/RecordingApp.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { onBeforeMount } from 'vue'
import { useRoute, useRouter } from 'vue-router'
import CallView from './components/CallView/CallView.vue'
import { useGetToken } from './composables/useGetToken.ts'
import SessionStorage from './services/SessionStorage.js'
import { useSoundsStore } from './stores/sounds.js'
import { useTokenStore } from './stores/token.ts'
import { signalingKill } from './utils/webrtc/index.js'
Expand All @@ -31,6 +32,7 @@ onBeforeMount(async () => {
window.addEventListener('unload', () => {
console.info('Navigating away, leaving conversation')
if (token.value) {
SessionStorage.removeItem('joined_conversation')
// We have to do this synchronously, because in unload and
// beforeunload Promises, async and await are prohibited.
signalingKill()
Expand Down
4 changes: 4 additions & 0 deletions src/store/participantsStore.js
Original file line number Diff line number Diff line change
Expand Up @@ -1101,6 +1101,10 @@ 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 Down
Loading