Skip to content

Commit 5ebdee5

Browse files
authored
Merge pull request #15789 from nextcloud/fix/noid/thread-list-ls
2 parents 67b6555 + fa7724e commit 5ebdee5

1 file changed

Lines changed: 25 additions & 3 deletions

File tree

src/components/LeftSidebar/LeftSidebar.vue

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@
164164
<NcAppNavigationItem
165165
class="navigation-item"
166166
:name="t('spreed', 'Back to conversations')"
167-
@click.prevent="showThreadsList = false; showArchived = false">
167+
@click.prevent="handleBackToConversations">
168168
<template #icon>
169169
<IconArrowLeft class="bidirectional-icon" :size="20" />
170170
</template>
@@ -177,7 +177,7 @@
177177
v-else-if="supportThreads && !showThreadsList && !isSearching && !isFiltered"
178178
class="navigation-item"
179179
:name="t('spreed', 'Followed threads')"
180-
@click.prevent="showThreadsList = true; showArchived = false">
180+
@click.prevent="handleShowThreadsList">
181181
<template #icon>
182182
<IconForumOutline :size="20" />
183183
</template>
@@ -488,6 +488,7 @@ export default {
488488
isCurrentTabLeader: false,
489489
isFocused: false,
490490
isNavigating: false,
491+
fallbackConversationToken: null,
491492
}
492493
},
493494
@@ -1004,6 +1005,10 @@ export default {
10041005
&& to.name === 'conversation'
10051006
&& from.params.token === to.params.token) {
10061007
// this is triggered when the hash in the URL changes
1008+
if (!to.query?.threadId) {
1009+
this.showThreadsList = false
1010+
this.fallbackConversationToken = null
1011+
}
10071012
return
10081013
}
10091014
if (from.name === 'conversation') {
@@ -1013,7 +1018,6 @@ export default {
10131018
this.abortSearch()
10141019
this.$store.dispatch('joinConversation', { token: to.params.token })
10151020
this.showArchived = this.$store.getters.conversation(to.params.token)?.isArchived ?? false
1016-
this.showThreadsList = false
10171021
this.scrollToConversation(to.params.token)
10181022
}
10191023
if (this.isMobile) {
@@ -1041,6 +1045,24 @@ export default {
10411045
EventBus.emit('refresh-talk-dashboard')
10421046
}
10431047
},
1048+
1049+
handleShowThreadsList() {
1050+
this.showThreadsList = true
1051+
this.showArchived = false
1052+
this.fallbackConversationToken = this.$route.params?.token
1053+
},
1054+
1055+
handleBackToConversations() {
1056+
this.showThreadsList = false
1057+
this.showArchived = false
1058+
if (this.fallbackConversationToken) {
1059+
this.$router.push({
1060+
name: 'conversation',
1061+
params: { token: this.fallbackConversationToken },
1062+
}).catch((err) => console.debug(`Error while pushing the fallback conversation's route: ${err}`))
1063+
this.fallbackConversationToken = null
1064+
}
1065+
},
10441066
},
10451067
}
10461068
</script>

0 commit comments

Comments
 (0)