mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
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
20 lines
526 B
JavaScript
20 lines
526 B
JavaScript
import Component from "@ember/component";
|
|
import { action } from "@ember/object";
|
|
import { inject as service } from "@ember/service";
|
|
|
|
export default class UserCardChatButton extends Component {
|
|
@service chat;
|
|
@service appEvents;
|
|
@service router;
|
|
|
|
@action
|
|
startChatting() {
|
|
this.chat
|
|
.upsertDmChannelForUsernames([this.user.username])
|
|
.then((chatChannel) => {
|
|
this.router.transitionTo("chat.channel", ...chatChannel.routeModels);
|
|
this.appEvents.trigger("card:close");
|
|
});
|
|
}
|
|
}
|