This commit is expanding on previous work making everything chat working through an URL. Improves drawer templates to be all URLs Implements some kind of router for the drawer Removes few remaining actions for opening channels
24 lines
549 B
JavaScript
24 lines
549 B
JavaScript
import Component from "@glimmer/component";
|
|
import { inject as service } from "@ember/service";
|
|
import { action } from "@ember/object";
|
|
|
|
export default class ChatDrawerChannel extends Component {
|
|
@service appEvents;
|
|
@service chat;
|
|
@service chatStateManager;
|
|
@service chatChannelsManager;
|
|
|
|
@action
|
|
fetchChannel() {
|
|
if (!this.args.params?.channelId) {
|
|
return;
|
|
}
|
|
|
|
return this.chatChannelsManager
|
|
.find(this.args.params.channelId)
|
|
.then((channel) => {
|
|
this.chat.activeChannel = channel;
|
|
});
|
|
}
|
|
}
|