Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 25 additions & 3 deletions src/components/LeftSidebar/LeftSidebar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@
<NcAppNavigationItem
class="navigation-item"
:name="t('spreed', 'Back to conversations')"
@click.prevent="showThreadsList = false; showArchived = false">
@click.prevent="handleBackToConversations">
<template #icon>
<IconArrowLeft class="bidirectional-icon" :size="20" />
</template>
Expand All @@ -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">
<template #icon>
<IconForumOutline :size="20" />
</template>
Expand Down Expand Up @@ -488,6 +488,7 @@ export default {
isCurrentTabLeader: false,
isFocused: false,
isNavigating: false,
fallbackConversationToken: null,
}
},

Expand Down Expand Up @@ -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') {
Expand All @@ -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) {
Expand Down Expand Up @@ -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
}
},
},
}
</script>
Expand Down