mirror of
https://github.com/hanzoai/forum.git
synced 2026-09-30 21:51:19 +00:00
The following case was bugged:
- visit a thread in full page chat
- click channel title
- click back button in channel navbar
- 💥 you would have a channel with limited width as if there was
still the thread showing next to it, but it was empty
32 lines
728 B
JavaScript
32 lines
728 B
JavaScript
import { action } from "@ember/object";
|
|
import { service } from "@ember/service";
|
|
import DiscourseRoute from "discourse/routes/discourse";
|
|
|
|
export default class ChatChannelThreads extends DiscourseRoute {
|
|
@service router;
|
|
@service chatThreadListPane;
|
|
@service chatStateManager;
|
|
@service chat;
|
|
|
|
beforeModel(transition) {
|
|
const channel = this.modelFor("chat.channel");
|
|
|
|
if (!channel.threadingEnabled) {
|
|
transition.abort();
|
|
this.router.transitionTo("chat.channel", ...channel.routeModels);
|
|
return;
|
|
}
|
|
}
|
|
|
|
@action
|
|
activate() {
|
|
this.chat.activeMessage = null;
|
|
this.chatStateManager.openSidePanel();
|
|
}
|
|
|
|
@action
|
|
deactivate() {
|
|
this.chatStateManager.closeSidePanel();
|
|
}
|
|
}
|