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:
Guhyoun Nam 2025-05-28 13:26:37 -05:00 committed by GitHub
parent d99c335dab
commit ad5c48d9ae
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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");
}