From eb3273121a651267b54f350eaf8bdc30f67d826a Mon Sep 17 00:00:00 2001 From: David Taylor Date: Wed, 8 Jan 2025 16:57:51 +0000 Subject: [PATCH] DEV: Always run backwards-compat logic There was a ~1 week period where the modifier existed in core, but only applied to the new topic list. Running the modifyClass unconditionally takes care of that. We'll be removing it once the raw-hbs topic list is removed in the next few months. --- .../initializers/init-topic-excerpts.js | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/javascripts/discourse/initializers/init-topic-excerpts.js b/javascripts/discourse/initializers/init-topic-excerpts.js index 30369bb..8970823 100644 --- a/javascripts/discourse/initializers/init-topic-excerpts.js +++ b/javascripts/discourse/initializers/init-topic-excerpts.js @@ -2,17 +2,12 @@ import { apiInitializer } from "discourse/lib/api"; import { withSilencedDeprecations } from "discourse-common/lib/deprecated"; export default apiInitializer("0.8", (api) => { - const transformerExists = api.registerValueTransformer( - "topic-list-item-expand-pinned", - () => true - ); + 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, - }); + withSilencedDeprecations("discourse.hbr-topic-list-overrides", () => { + api.modifyClass("component:topic-list-item", { + pluginId: "discourse-air", + expandPinned: true, }); - } + }); });