Skip to content
This repository was archived by the owner on Jul 22, 2025. It is now read-only.

Commit 3440395

Browse files
authored
DEV: include excerpt-expanded class when gists are enabled (#1267)
1 parent b5d42f3 commit 3440395

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import { apiInitializer } from "discourse/lib/api";
2+
3+
export default apiInitializer("1.15.0", (api) => {
4+
const gistService = api.container.lookup("service:gists");
5+
6+
api.registerValueTransformer(
7+
"topic-list-item-class",
8+
({ value, context }) => {
9+
const shouldShow =
10+
gistService.preference === "table-ai" && gistService.shouldShow;
11+
12+
if (context.topic.get("ai_topic_gist") && shouldShow) {
13+
value.push("excerpt-expanded");
14+
}
15+
16+
return value;
17+
}
18+
);
19+
});

0 commit comments

Comments
 (0)