FIX: deactivate is not called in every cases (#19301)
Resets active channel each time we transition through "chat" route.
This commit is contained in:
parent
ef31c7df63
commit
801b3f087f
|
@ -66,8 +66,6 @@ export default class ChatRoute extends DiscourseRoute {
|
|||
}
|
||||
|
||||
deactivate() {
|
||||
this.chat.setActiveChannel(null);
|
||||
|
||||
schedule("afterRender", () => {
|
||||
document.body.classList.remove("has-full-page-chat");
|
||||
document.documentElement.classList.remove("has-full-page-chat");
|
||||
|
@ -77,6 +75,8 @@ export default class ChatRoute extends DiscourseRoute {
|
|||
|
||||
@action
|
||||
willTransition(transition) {
|
||||
this.chat.setActiveChannel(null);
|
||||
|
||||
if (!transition?.to?.name?.startsWith("chat.")) {
|
||||
this.chatStateManager.storeChatURL();
|
||||
this.chat.updatePresence();
|
||||
|
|
Loading…
Reference in New Issue