DEV: include excerpt-expanded class when gists are enabled (#1267)
This commit is contained in:
parent
b5d42f373b
commit
3440395623
|
@ -0,0 +1,19 @@
|
||||||
|
import { apiInitializer } from "discourse/lib/api";
|
||||||
|
|
||||||
|
export default apiInitializer("1.15.0", (api) => {
|
||||||
|
const gistService = api.container.lookup("service:gists");
|
||||||
|
|
||||||
|
api.registerValueTransformer(
|
||||||
|
"topic-list-item-class",
|
||||||
|
({ value, context }) => {
|
||||||
|
const shouldShow =
|
||||||
|
gistService.preference === "table-ai" && gistService.shouldShow;
|
||||||
|
|
||||||
|
if (context.topic.get("ai_topic_gist") && shouldShow) {
|
||||||
|
value.push("excerpt-expanded");
|
||||||
|
}
|
||||||
|
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
);
|
||||||
|
});
|
Loading…
Reference in New Issue