From 210559edc840c70e0b463559ff5e82a2129a2311 Mon Sep 17 00:00:00 2001 From: David Taylor Date: Mon, 6 Jan 2025 22:33:36 +0000 Subject: [PATCH] DEV: Support expand-pinned modifier in legacy topic-list (#30587) This provides an easier upgrade path for themes/plugins. Matches the strategy used for other new topic-list-related modifiers. --- .../discourse/app/components/topic-list-item.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/app/assets/javascripts/discourse/app/components/topic-list-item.js b/app/assets/javascripts/discourse/app/components/topic-list-item.js index 7aef22dfbb8..7682aafd8df 100644 --- a/app/assets/javascripts/discourse/app/components/topic-list-item.js +++ b/app/assets/javascripts/discourse/app/components/topic-list-item.js @@ -13,6 +13,7 @@ import { observes, on } from "@ember-decorators/object"; import $ from "jquery"; import { topicTitleDecorators } from "discourse/components/topic-title"; import { wantsNewWindow } from "discourse/lib/intercept-click"; +import { applyValueTransformer } from "discourse/lib/transformer"; import DiscourseURL, { groupPath } from "discourse/lib/url"; import deprecated from "discourse-common/lib/deprecated"; import { RUNTIME_OPTIONS } from "discourse-common/lib/raw-handlebars-helpers"; @@ -243,6 +244,17 @@ export default class TopicListItem extends Component { @discourseComputed expandPinned() { + return applyValueTransformer( + "topic-list-item-expand-pinned", + this._expandPinned, + { + topic: this.topic, + mobileView: this.site.mobileView, + } + ); + } + + get _expandPinned() { const pinned = this.get("topic.pinned"); if (!pinned) { return false;