Skip to content

Commit

Permalink
DEV: Always run backwards-compat logic
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
davidtaylorhq committed Jan 8, 2025
1 parent 7cbd064 commit eb32731
Showing 1 changed file with 6 additions and 11 deletions.
17 changes: 6 additions & 11 deletions javascripts/discourse/initializers/init-topic-excerpts.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
});
}
});
});

0 comments on commit eb32731

Please sign in to comment.