mirror of
https://github.com/discourse/discourse-ai.git
synced 2025-06-23 16:12:21 +00:00
DEV: Add appEvents trigger for AI New Question button (#1379)
* DEV: Add appEvents trigger for AI New Question button * appEvent name update
This commit is contained in:
parent
d99c335dab
commit
ad5c48d9ae
@ -5,6 +5,7 @@ import DButton from "discourse/components/d-button";
|
||||
import { AI_CONVERSATIONS_PANEL } from "../services/ai-conversations-sidebar-manager";
|
||||
|
||||
export default class AiBotSidebarNewConversation extends Component {
|
||||
@service appEvents;
|
||||
@service router;
|
||||
@service sidebarState;
|
||||
|
||||
@ -14,6 +15,8 @@ export default class AiBotSidebarNewConversation extends Component {
|
||||
|
||||
@action
|
||||
routeTo() {
|
||||
this.appEvents.trigger("discourse-ai:new-conversation-btn-clicked");
|
||||
|
||||
if (this.router.currentRouteName !== "discourse-ai-bot-conversations") {
|
||||
this.router.transitionTo("/discourse-ai/ai-bot/conversations");
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user