diff --git a/plugins/chat/assets/javascripts/discourse/routes/chat-channel.js b/plugins/chat/assets/javascripts/discourse/routes/chat-channel.js index 0d39e368eb..4a4f9f29d3 100644 --- a/plugins/chat/assets/javascripts/discourse/routes/chat-channel.js +++ b/plugins/chat/assets/javascripts/discourse/routes/chat-channel.js @@ -9,8 +9,15 @@ export default class ChatChannelRoute extends DiscourseRoute { @service chatStateManager; @action - willTransition() { + willTransition(transition) { + this.chat.activeThread = null; this.chatStateManager.closeSidePanel(); + + if (!transition?.to?.name?.startsWith("chat.")) { + this.chatStateManager.storeChatURL(); + this.chat.setActiveChannel(null); + this.chat.updatePresence(); + } } beforeModel() {