Skip to content

Commit 83e2797

Browse files
DEV: Always run backwards-compat logic (discourse#67)
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.
1 parent 7cbd064 commit 83e2797

File tree

1 file changed

+6
-11
lines changed

1 file changed

+6
-11
lines changed

javascripts/discourse/initializers/init-topic-excerpts.js

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,12 @@ import { apiInitializer } from "discourse/lib/api";
22
import { withSilencedDeprecations } from "discourse-common/lib/deprecated";
33

44
export default apiInitializer("0.8", (api) => {
5-
const transformerExists = api.registerValueTransformer(
6-
"topic-list-item-expand-pinned",
7-
() => true
8-
);
5+
api.registerValueTransformer("topic-list-item-expand-pinned", () => true);
96

10-
if (!transformerExists) {
11-
withSilencedDeprecations("discourse.hbr-topic-list-overrides", () => {
12-
api.modifyClass("component:topic-list-item", {
13-
pluginId: "discourse-air",
14-
expandPinned: true,
15-
});
7+
withSilencedDeprecations("discourse.hbr-topic-list-overrides", () => {
8+
api.modifyClass("component:topic-list-item", {
9+
pluginId: "discourse-air",
10+
expandPinned: true,
1611
});
17-
}
12+
});
1813
});

0 commit comments

Comments
 (0)