diff --git a/src/App.vue b/src/App.vue index 1d88ccd5d3e..17fee5cd418 100644 --- a/src/App.vue +++ b/src/App.vue @@ -254,6 +254,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() diff --git a/src/FilesSidebarTabApp.vue b/src/FilesSidebarTabApp.vue index f219c814fbb..7471231b04a 100644 --- a/src/FilesSidebarTabApp.vue +++ b/src/FilesSidebarTabApp.vue @@ -44,6 +44,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' @@ -173,6 +174,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() diff --git a/src/PublicShareAuthSidebar.vue b/src/PublicShareAuthSidebar.vue index 9746dfb0ee5..92af9513c76 100644 --- a/src/PublicShareAuthSidebar.vue +++ b/src/PublicShareAuthSidebar.vue @@ -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' @@ -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() diff --git a/src/PublicShareSidebar.vue b/src/PublicShareSidebar.vue index 72d61a8c805..393d7bfd7a2 100644 --- a/src/PublicShareSidebar.vue +++ b/src/PublicShareSidebar.vue @@ -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' @@ -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() diff --git a/src/RecordingApp.vue b/src/RecordingApp.vue index fc910c97ad8..f7bada6859f 100644 --- a/src/RecordingApp.vue +++ b/src/RecordingApp.vue @@ -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' @@ -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() diff --git a/src/store/participantsStore.js b/src/store/participantsStore.js index 36a47d70906..e24846417de 100644 --- a/src/store/participantsStore.js +++ b/src/store/participantsStore.js @@ -1099,6 +1099,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', {