DEV: Remove computed field

There was a lot of code for very little functionality and it caused
issues with other plugin tests.
This commit is contained in:
Bianca Nenciu 2020-07-10 15:46:40 +03:00
parent 47ae7d38d5
commit 0d4f38404b
2 changed files with 1 additions and 15 deletions

View File

@ -1,5 +1,3 @@
import { computed } from "@ember/object";
import Category from "discourse/models/category";
import { withPluginApi } from "discourse/lib/plugin-api";
function initialize(api) {
@ -46,17 +44,5 @@ export default {
initialize() {
withPluginApi("0.8.4", api => initialize(api));
withPluginApi("0.8.30", api => api.addCategorySortCriteria("votes"));
Category.reopen({
enable_topic_voting: computed("custom_fields.enable_topic_voting", {
get(enableField) {
return enableField;
},
set(value) {
this.set("custom_fields.enable_topic_voting", value);
return value;
}
})
});
}
};

View File

@ -2,7 +2,7 @@
<section class='field'>
<div class="enable-topic-voting">
<label class="checkbox-label">
{{input type="checkbox" checked=category.enable_topic_voting}}
{{input type="checkbox" checked=category.custom_fields.enable_topic_voting}}
{{i18n 'voting.allow_topic_voting'}}
</label>
</div>