mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
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() {
|
deactivate() {
|
||||||
this.chat.setActiveChannel(null);
|
|
||||||
|
|
||||||
schedule("afterRender", () => {
|
schedule("afterRender", () => {
|
||||||
document.body.classList.remove("has-full-page-chat");
|
document.body.classList.remove("has-full-page-chat");
|
||||||
document.documentElement.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
|
@action
|
||||||
willTransition(transition) {
|
willTransition(transition) {
|
||||||
|
this.chat.setActiveChannel(null);
|
||||||
|
|
||||||
if (!transition?.to?.name?.startsWith("chat.")) {
|
if (!transition?.to?.name?.startsWith("chat.")) {
|
||||||
this.chatStateManager.storeChatURL();
|
this.chatStateManager.storeChatURL();
|
||||||
this.chat.updatePresence();
|
this.chat.updatePresence();
|
||||||
|
Loading…
Reference in New Issue
Block a user