From e9fc1fec2c7404a9064bb1f12916a176438da839 Mon Sep 17 00:00:00 2001 From: David Taylor Date: Mon, 6 Jan 2025 16:27:49 +0000 Subject: [PATCH] DEV: Update for glimmer topic list --- .discourse-compatibility | 1 + .../initializers/init-topic-excerpts.js | 18 ++++++++++++++---- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/.discourse-compatibility b/.discourse-compatibility index 45b3aab3..f92f447d 100644 --- a/.discourse-compatibility +++ b/.discourse-compatibility @@ -1,3 +1,4 @@ +< 3.4.0.beta4-dev: a5ff3374335f17b46654c4ae1e5be7b539c2da1a < 3.4.0.beta1-dev: 93551f55d6e9f8d688f1f9dc0b6a2f14eb08b603 < 3.3.0.beta1-dev: 85dc24d6b58d1b16e6d225ae710633dc20c34d08 3.1.999: 1e5882a1541b932f9512f6a7d667b333c1708f53 diff --git a/javascripts/discourse/initializers/init-topic-excerpts.js b/javascripts/discourse/initializers/init-topic-excerpts.js index 677a5d2d..30369bb3 100644 --- a/javascripts/discourse/initializers/init-topic-excerpts.js +++ b/javascripts/discourse/initializers/init-topic-excerpts.js @@ -1,8 +1,18 @@ import { apiInitializer } from "discourse/lib/api"; +import { withSilencedDeprecations } from "discourse-common/lib/deprecated"; export default apiInitializer("0.8", (api) => { - api.modifyClass("component:topic-list-item", { - pluginId: "discourse-air", - expandPinned: true, - }); + const transformerExists = api.registerValueTransformer( + "topic-list-item-expand-pinned", + () => true + ); + + if (!transformerExists) { + withSilencedDeprecations("discourse.hbr-topic-list-overrides", () => { + api.modifyClass("component:topic-list-item", { + pluginId: "discourse-air", + expandPinned: true, + }); + }); + } });