diff --git a/assets/javascripts/discourse/components/post-menu/ai-cancel-streaming-button.gjs b/assets/javascripts/discourse/components/post-menu/ai-cancel-streaming-button.gjs index aa3cef2c..3fa2170e 100644 --- a/assets/javascripts/discourse/components/post-menu/ai-cancel-streaming-button.gjs +++ b/assets/javascripts/discourse/components/post-menu/ai-cancel-streaming-button.gjs @@ -5,8 +5,10 @@ import { ajax } from "discourse/lib/ajax"; import { popupAjaxError } from "discourse/lib/ajax-error"; export default class AiCancelStreamingButton extends Component { - // TODO (glimmer-post-menu): Remove this static function and move the code into the button action after the widget code is removed - static async cancelStreaming(post) { + @action + async cancelStreaming() { + const post = this.args.post; + try { await ajax(`/discourse-ai/ai-bot/post/${post.id}/stop-streaming`, { type: "POST", @@ -20,11 +22,6 @@ export default class AiCancelStreamingButton extends Component { } } - @action - cancelStreaming() { - this.constructor.cancelStreaming(this.args.post); - } -