mirror of
https://ghfast.top/https://github.com/discourse/discourse-solved.git
synced 2026-05-26 01:04:40 +08:00
19 lines
438 B
JavaScript
19 lines
438 B
JavaScript
import { withPluginApi } from "discourse/lib/plugin-api";
|
|
|
|
export default {
|
|
name: "add-topic-list-class",
|
|
|
|
initialize() {
|
|
withPluginApi("1.39.0", (api) => {
|
|
api.registerValueTransformer(
|
|
"topic-list-item-class",
|
|
({ value, context }) => {
|
|
if (context.topic.get("has_accepted_answer")) {
|
|
value.push("status-solved");
|
|
}
|
|
return value;
|
|
}
|
|
);
|
|
});
|
|
},
|
|
};
|