mirror of
https://github.com/hanzoai/forum.git
synced 2026-09-30 21:51:19 +00:00
`chatThreadPane.isOpened` was returning `false` when it should return `true` due to an incorrect matching on the route. Note that visiting a thread will focus the composer and the first escape will blur the input, only the second will close the panel.
34 lines
767 B
JavaScript
34 lines
767 B
JavaScript
import { service } from "@ember/service";
|
|
import ChatChannelPane from "./chat-channel-pane";
|
|
|
|
export default class ChatThreadPane extends ChatChannelPane {
|
|
@service chat;
|
|
@service router;
|
|
|
|
get thread() {
|
|
return this.channel?.activeThread;
|
|
}
|
|
|
|
get isOpened() {
|
|
return (
|
|
this.router.currentRoute.name === "chat.channel.thread" ||
|
|
this.router.currentRoute.name === "chat.channel.thread.index"
|
|
);
|
|
}
|
|
|
|
get selectedMessageIds() {
|
|
return this.thread.messagesManager.selectedMessages.mapBy("id");
|
|
}
|
|
|
|
async close() {
|
|
await this.router.transitionTo("chat.channel", ...this.channel.routeModels);
|
|
}
|
|
|
|
async open(thread) {
|
|
await this.router.transitionTo(
|
|
"chat.channel.thread",
|
|
...thread.routeModels
|
|
);
|
|
}
|
|
}
|