diff --git a/src/App.vue b/src/App.vue index e4c84c82574..b53ace45b11 100644 --- a/src/App.vue +++ b/src/App.vue @@ -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() diff --git a/src/FilesSidebarTabApp.vue b/src/FilesSidebarTabApp.vue index 3c8e6cdc5d9..3d6f4a2f533 100644 --- a/src/FilesSidebarTabApp.vue +++ b/src/FilesSidebarTabApp.vue @@ -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' @@ -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() diff --git a/src/PublicShareAuthSidebar.vue b/src/PublicShareAuthSidebar.vue index a6f6b2d63b0..6fc97c2d986 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 d773a658541..4e2446c65ee 100644 --- a/src/store/participantsStore.js +++ b/src/store/participantsStore.js @@ -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', {