diff --git a/assets/javascripts/discourse/connectors/topic-map-expanded-after/ai-summary-box.gjs b/assets/javascripts/discourse/connectors/topic-map-expanded-after/ai-summary-box.gjs index 69b2ac3e..878f27cd 100644 --- a/assets/javascripts/discourse/connectors/topic-map-expanded-after/ai-summary-box.gjs +++ b/assets/javascripts/discourse/connectors/topic-map-expanded-after/ai-summary-box.gjs @@ -21,6 +21,7 @@ export default class AiSummaryBox extends Component { @service siteSettings; @service messageBus; @service currentUser; + @service site; @tracked text = ""; @tracked summarizedOn = null; @@ -123,7 +124,9 @@ export default class AiSummaryBox extends Component { }) .then(() => { if (update.done) { - this.summarizedOn = shortDateNoYear(topicSummary.updated_at); + this.summarizedOn = shortDateNoYear( + moment(topicSummary.updated_at, "YYYY-MM-DD HH:mm:ss Z") + ); this.summarizedBy = topicSummary.algorithm; this.newPostsSinceSummary = topicSummary.new_posts_since_summary; this.outdated = topicSummary.outdated; @@ -134,6 +137,17 @@ export default class AiSummaryBox extends Component { }); } + @action + onRegisterApi(api) { + this.dMenu = api; + } + + @action + async onClose() { + await this.dMenu.close(); + this.unsubscribe(); + } +