diff --git a/app/assets/javascripts/discourse/app/components/summary-box.hbs b/app/assets/javascripts/discourse/app/components/summary-box.hbs index 4de34ca792f..d387b6780f1 100644 --- a/app/assets/javascripts/discourse/app/components/summary-box.hbs +++ b/app/assets/javascripts/discourse/app/components/summary-box.hbs @@ -1,9 +1,9 @@
- {{#if @postAttrs.hasTopRepliesSummary}} + {{#if this.topRepliesSummaryEnabled}}

{{html-safe this.topRepliesSummaryInfo}}

{{/if}}
- {{#if @postAttrs.summarizable}} + {{#if @topic.summarizable}} {{#if this.summary.showSummaryBox}} 0 ) { outdatedText += " "; @@ -40,29 +40,29 @@ export default class SummaryBox extends Component { } get topRepliesSummaryEnabled() { - return this.args.postAttrs.topicSummaryEnabled; + return this.args.topic.has_summary; } get topRepliesSummaryInfo() { - if (this.args.postAttrs.topicSummaryEnabled) { + if (this.topRepliesSummaryEnabled) { return I18n.t("summary.enabled_description"); } - const wordCount = this.args.postAttrs.topicWordCount; + const wordCount = this.args.topic.word_count; if (wordCount && this.siteSettings.read_time_word_count > 0) { const readingTime = Math.ceil( Math.max( wordCount / this.siteSettings.read_time_word_count, - (this.args.postAttrs.topicPostsCount * MIN_POST_READ_TIME) / 60 + (this.args.topic.posts_count * MIN_POST_READ_TIME) / 60 ) ); return I18n.messageFormat("summary.description_time_MF", { - replyCount: this.args.postAttrs.topicReplyCount, + replyCount: this.args.topic.replyCount, readingTime, }); } return I18n.t("summary.description", { - count: this.args.postAttrs.topicReplyCount, + count: this.args.topic.replyCount, }); } diff --git a/app/assets/javascripts/discourse/app/components/topic-map.gjs b/app/assets/javascripts/discourse/app/components/topic-map.gjs index 4c11d92f691..155bfa61f2f 100644 --- a/app/assets/javascripts/discourse/app/components/topic-map.gjs +++ b/app/assets/javascripts/discourse/app/components/topic-map.gjs @@ -9,7 +9,11 @@ import concatClass from "discourse/helpers/concat-class"; import or from "truth-helpers/helpers/or"; export default class TopicMap extends Component { - @tracked collapsed = !this.args.postAttrs.hasTopRepliesSummary; + @tracked collapsed = !this.args.model.has_summary; + + get userFilters() { + return this.args.postStream.userFilters || []; + } @action toggleMap() { @@ -19,9 +23,11 @@ export default class TopicMap extends Component {