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
diff options
context:
space:
mode:
authorDaniel Calviño Sánchez <danxuliu@gmail.com>2020-01-15 19:17:41 +0300
committerDaniel Calviño Sánchez <danxuliu@gmail.com>2020-01-16 20:33:39 +0300
commit1efe60980e5268418ec9a95e1d96492c2ba5fc89 (patch)
tree52e35f1f9c17aeae128ed51cd7a4274aab464bba /src/PublicShareSidebar.vue
parentddb0c36ccd0603833551a55995b06689fdf7bf56 (diff)
Leave conversation when navigating away from public share page
Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
Diffstat (limited to 'src/PublicShareSidebar.vue')
-rw-r--r--src/PublicShareSidebar.vue24
1 files changed, 22 insertions, 2 deletions
diff --git a/src/PublicShareSidebar.vue b/src/PublicShareSidebar.vue
index 1120aff34..6cf714a93 100644
--- a/src/PublicShareSidebar.vue
+++ b/src/PublicShareSidebar.vue
@@ -48,8 +48,14 @@ import { PARTICIPANT } from './constants'
import { EventBus } from './services/EventBus'
import { fetchConversation } from './services/conversationsService'
import { getPublicShareConversationData } from './services/filesIntegrationServices'
-import { joinConversation } from './services/participantsService'
-import { getSignaling } from './utils/webrtc/index'
+import {
+ joinConversation,
+ leaveConversationSync,
+} from './services/participantsService'
+import {
+ getSignaling,
+ getSignalingSync,
+} from './utils/webrtc/index'
export default {
@@ -106,6 +112,20 @@ export default {
},
},
+ beforeMount() {
+ window.addEventListener('unload', () => {
+ if (this.token) {
+ // We have to do this synchronously, because in unload and beforeunload
+ // Promises, async and await are prohibited.
+ const signaling = getSignalingSync()
+ if (signaling) {
+ signaling.disconnect()
+ }
+ leaveConversationSync(this.token)
+ }
+ })
+ },
+
methods: {
async joinConversation() {