mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
This commit contains multiple changes to improve the composer behavior especially in the context of a thread: - Generally rename anything of the form `chatChannelThread...` to `chatThread...`` - Moves the textarea interactor instance inside the composer server - Improves the focus state and closing of panel related to the use of the Escape shortcut - Creates `Chat::ThreadList` as a component instead of having `Chat::Thread::ListItem` and others which could imply they were children of a the `Chat::Thread` component
30 lines
669 B
JavaScript
30 lines
669 B
JavaScript
import ChatChannelPane from "./chat-channel-pane";
|
|
import { inject as service } from "@ember/service";
|
|
|
|
export default class ChatThreadPane extends ChatChannelPane {
|
|
@service chat;
|
|
@service router;
|
|
|
|
get isOpened() {
|
|
return this.router.currentRoute.name === "chat.channel.thread";
|
|
}
|
|
|
|
async close() {
|
|
await this.router.transitionTo(
|
|
"chat.channel",
|
|
...this.chat.activeChannel.routeModels
|
|
);
|
|
}
|
|
|
|
async open(thread) {
|
|
await this.router.transitionTo(
|
|
"chat.channel.thread",
|
|
...thread.routeModels
|
|
);
|
|
}
|
|
|
|
get selectedMessageIds() {
|
|
return this.chat.activeChannel.activeThread.selectedMessages.mapBy("id");
|
|
}
|
|
}
|