DEV: Fix routing not nulling channel/thread

This commit is contained in:
Martin Brennan 2023-02-10 10:16:25 +10:00
parent f6081a9277
commit 218dbc249a
No known key found for this signature in database
GPG Key ID: A08063EEF3EA26A4

View File

@ -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() {