diff --git a/src/components/LeftSidebar/LeftSidebar.vue b/src/components/LeftSidebar/LeftSidebar.vue index 08631b2d814..077c7f01715 100644 --- a/src/components/LeftSidebar/LeftSidebar.vue +++ b/src/components/LeftSidebar/LeftSidebar.vue @@ -164,7 +164,7 @@ + @click.prevent="handleBackToConversations"> @@ -177,7 +177,7 @@ v-else-if="supportThreads && !showThreadsList && !isSearching && !isFiltered" class="navigation-item" :name="t('spreed', 'Followed threads')" - @click.prevent="showThreadsList = true; showArchived = false"> + @click.prevent="handleShowThreadsList"> @@ -488,6 +488,7 @@ export default { isCurrentTabLeader: false, isFocused: false, isNavigating: false, + fallbackConversationToken: null, } }, @@ -1004,6 +1005,10 @@ export default { && to.name === 'conversation' && from.params.token === to.params.token) { // this is triggered when the hash in the URL changes + if (!to.query?.threadId) { + this.showThreadsList = false + this.fallbackConversationToken = null + } return } if (from.name === 'conversation') { @@ -1013,7 +1018,6 @@ export default { this.abortSearch() this.$store.dispatch('joinConversation', { token: to.params.token }) this.showArchived = this.$store.getters.conversation(to.params.token)?.isArchived ?? false - this.showThreadsList = false this.scrollToConversation(to.params.token) } if (this.isMobile) { @@ -1041,6 +1045,24 @@ export default { EventBus.emit('refresh-talk-dashboard') } }, + + handleShowThreadsList() { + this.showThreadsList = true + this.showArchived = false + this.fallbackConversationToken = this.$route.params?.token + }, + + handleBackToConversations() { + this.showThreadsList = false + this.showArchived = false + if (this.fallbackConversationToken) { + this.$router.push({ + name: 'conversation', + params: { token: this.fallbackConversationToken }, + }).catch((err) => console.debug(`Error while pushing the fallback conversation's route: ${err}`)) + this.fallbackConversationToken = null + } + }, }, }