Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .discourse-compatibility
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
< 3.5.0.beta4-dev: 1ebd81ac51a035c6396d4f22a658510726141b6e
32 changes: 0 additions & 32 deletions javascripts/discourse/initializers/solved-badge.js
Original file line number Diff line number Diff line change
@@ -1,42 +1,10 @@
import { withPluginApi } from "discourse/lib/plugin-api";
import { withSilencedDeprecations } from "discourse/lib/deprecated";
import discourseComputed from "discourse-common/utils/decorators";
import TopicListItem from "discourse/components/topic-list-item";
import LatestTopicListItem from "discourse/components/latest-topic-list-item";

export default {
name: "solved-badge",

initialize(container) {
withPluginApi("1.39.0", api => {
// Should remove after the glimmer topic list transition
withSilencedDeprecations("discourse.hbr-topic-list-overrides", () => {
TopicListItem.reopen({
@discourseComputed()
unboundClassNames() {
let classList = this._super(...arguments);
if (this.topic.can_have_answer) {
classList += " solvable";
}
return classList;
},
});

LatestTopicListItem.reopen({
@discourseComputed()
unboundClassNames() {
let classList = this._super(...arguments);
if (this.topic.can_have_answer) {
classList += " solvable";
}
if (this.topic.has_accepted_answer) {
classList += " status-solved";
}
return classList;
},
});
});

api.registerValueTransformer(
"topic-list-item-class",
({ value, context }) => {
Expand Down