From d7ef138f645412c17320006eacd76afc75f9d297 Mon Sep 17 00:00:00 2001 From: "Grigorii K. Shartsev" Date: Tue, 6 Aug 2024 14:38:58 +0200 Subject: [PATCH 1/2] fix(RightSidebar): move unread messages notifications discard to RightSidebar Signed-off-by: Grigorii K. Shartsev --- src/components/RightSidebar/RightSidebar.vue | 3 +++ src/components/TopBar/TopBar.vue | 1 - 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/components/RightSidebar/RightSidebar.vue b/src/components/RightSidebar/RightSidebar.vue index 24310abcf73..7eddfe23d5f 100644 --- a/src/components/RightSidebar/RightSidebar.vue +++ b/src/components/RightSidebar/RightSidebar.vue @@ -412,6 +412,9 @@ export default { beforeDestroy() { unsubscribe('spreed:select-active-sidebar-tab', this.handleUpdateActive) + + // Discard current chat notifications + this.notifyUnreadMessages(null) }, methods: { diff --git a/src/components/TopBar/TopBar.vue b/src/components/TopBar/TopBar.vue index 0efedd6af4f..5b0a0b9065d 100644 --- a/src/components/TopBar/TopBar.vue +++ b/src/components/TopBar/TopBar.vue @@ -274,7 +274,6 @@ export default { }, beforeDestroy() { - this.notifyUnreadMessages(null) document.removeEventListener('fullscreenchange', this.fullScreenChanged, false) document.removeEventListener('mozfullscreenchange', this.fullScreenChanged, false) document.removeEventListener('MSFullscreenChange', this.fullScreenChanged, false) From 12cfd26d6b7b806291a0730ab2c06d6529d82013 Mon Sep 17 00:00:00 2001 From: "Grigorii K. Shartsev" Date: Tue, 6 Aug 2024 14:39:21 +0200 Subject: [PATCH 2/2] fix(RightSidebar): discard unread notifications on conversation change Signed-off-by: Grigorii K. Shartsev --- src/components/RightSidebar/RightSidebar.vue | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/components/RightSidebar/RightSidebar.vue b/src/components/RightSidebar/RightSidebar.vue index 7eddfe23d5f..4fcdd03a911 100644 --- a/src/components/RightSidebar/RightSidebar.vue +++ b/src/components/RightSidebar/RightSidebar.vue @@ -390,6 +390,9 @@ export default { if (this.$refs.participantsTab) { this.$refs.participantsTab.$el.scrollTop = 0 } + + // Discard notification if the conversation changes or closed + this.notifyUnreadMessages(null) }, isModeratorOrUser(newValue) { @@ -412,9 +415,6 @@ export default { beforeDestroy() { unsubscribe('spreed:select-active-sidebar-tab', this.handleUpdateActive) - - // Discard current chat notifications - this.notifyUnreadMessages(null) }, methods: {