diff --git a/assets/javascripts/discourse/connectors/category-custom-settings/solved-settings.hbs b/assets/javascripts/discourse/connectors/category-custom-settings/solved-settings.hbs
index de81877..51bcda7 100644
--- a/assets/javascripts/discourse/connectors/category-custom-settings/solved-settings.hbs
+++ b/assets/javascripts/discourse/connectors/category-custom-settings/solved-settings.hbs
@@ -1,11 +1,15 @@
{{#unless siteSettings.allow_solved_on_all_topics}}
-
{{i18n 'solved.title'}}
-
-
-
-
-
+ {{i18n 'solved.title'}}
+
+
+
+
+
{{/unless}}
diff --git a/assets/javascripts/discourse/connectors/category-custom-settings/solved-settings.js.es6 b/assets/javascripts/discourse/connectors/category-custom-settings/solved-settings.js.es6
new file mode 100644
index 0000000..41697d3
--- /dev/null
+++ b/assets/javascripts/discourse/connectors/category-custom-settings/solved-settings.js.es6
@@ -0,0 +1,10 @@
+export default {
+ actions: {
+ onChangeSetting(value) {
+ this.set(
+ "category.custom_fields.enable_accepted_answers",
+ value ? "true" : "false"
+ );
+ }
+ }
+};
diff --git a/assets/javascripts/discourse/pre-initializers/extend-category-for-solved.js.es6 b/assets/javascripts/discourse/pre-initializers/extend-category-for-solved.js.es6
index 2a36f6d..d45af81 100644
--- a/assets/javascripts/discourse/pre-initializers/extend-category-for-solved.js.es6
+++ b/assets/javascripts/discourse/pre-initializers/extend-category-for-solved.js.es6
@@ -10,13 +10,8 @@ export default {
enable_accepted_answers: Ember.computed(
"custom_fields.enable_accepted_answers",
{
- get(enableField) {
- return enableField === "true";
- },
- set(value) {
- value = value ? "true" : "false";
- this.set("custom_fields.enable_accepted_answers", value);
- return value;
+ get(fieldName) {
+ return Ember.get(this.custom_fields, fieldName) === "true";
}
}
)