From 1d05dfa6dfd52662bc6c616a7f42e0612d016758 Mon Sep 17 00:00:00 2001 From: Maksim Sukharev Date: Tue, 29 Oct 2024 18:14:51 +0100 Subject: [PATCH] fix: listen to dialog triggers from URL hash only when conversation is open Signed-off-by: Maksim Sukharev --- src/App.vue | 8 -------- .../ConversationSettingsDialog.vue | 3 +-- src/components/MediaSettings/MediaSettings.vue | 2 +- src/views/MainView.vue | 17 +++++++++++++++++ 4 files changed, 19 insertions(+), 11 deletions(-) diff --git a/src/App.vue b/src/App.vue index fb078fda7e8..c42b42b599d 100644 --- a/src/App.vue +++ b/src/App.vue @@ -474,10 +474,6 @@ export default { } else if (to.name === 'notfound') { this.setPageTitle('') } - - if (to.hash === '#direct-call') { - emit('talk:media-settings:show') - } }) if (getCurrentUser()) { @@ -502,10 +498,6 @@ export default { }) } - if (this.$route.hash === '#direct-call') { - emit('talk:media-settings:show') - } - subscribe('notifications:action:execute', this.interceptNotificationActions) subscribe('notifications:notification:received', this.interceptNotificationReceived) }, diff --git a/src/components/ConversationSettings/ConversationSettingsDialog.vue b/src/components/ConversationSettings/ConversationSettingsDialog.vue index ec0f6a2fb8e..011a77b3fa3 100644 --- a/src/components/ConversationSettings/ConversationSettingsDialog.vue +++ b/src/components/ConversationSettings/ConversationSettingsDialog.vue @@ -267,10 +267,9 @@ export default { } }, - mounted() { + beforeMount() { subscribe('show-conversation-settings', this.handleShowSettings) subscribe('hide-conversation-settings', this.handleHideSettings) - }, beforeDestroy() { diff --git a/src/components/MediaSettings/MediaSettings.vue b/src/components/MediaSettings/MediaSettings.vue index 5a0e72068df..eb2fd8af0f9 100644 --- a/src/components/MediaSettings/MediaSettings.vue +++ b/src/components/MediaSettings/MediaSettings.vue @@ -466,7 +466,7 @@ export default { }, }, - mounted() { + beforeMount() { subscribe('talk:media-settings:show', this.showModal) subscribe('talk:media-settings:hide', this.closeModalAndApplySettings) diff --git a/src/views/MainView.vue b/src/views/MainView.vue index 84db84b8400..ed679a02776 100644 --- a/src/views/MainView.vue +++ b/src/views/MainView.vue @@ -16,6 +16,8 @@