From 218dbc249a9ef93bb78c3ff67c8031b042c52d9d Mon Sep 17 00:00:00 2001 From: Martin Brennan Date: Fri, 10 Feb 2023 10:16:25 +1000 Subject: [PATCH] DEV: Fix routing not nulling channel/thread --- .../assets/javascripts/discourse/routes/chat-channel.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) 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() {