mirror of
https://ghfast.top/https://github.com/discourse/discourse-solved.git
synced 2026-07-18 11:59:46 +08:00
Refactored the `topic` model to replace legacy Ember property access (`get/set`) with modern tracked properties. Updated related logic in `add-topic-list-class` and `solved-unaccept-answer-button` to align with these changes.
19 lines
431 B
JavaScript
19 lines
431 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.has_accepted_answer) {
|
|
value.push("status-solved");
|
|
}
|
|
return value;
|
|
}
|
|
);
|
|
});
|
|
},
|
|
};
|