discourse/app/assets/javascripts/admin/components/site-settings/bool.js

Failed to ignore revisions in .git-blame-ignore-revs.

20 lines
453 B
JavaScript
Raw Normal View History

import discourseComputed from "discourse-common/utils/decorators";
import { isEmpty } from "@ember/utils";
import Component from "@ember/component";
export default Component.extend({
@discourseComputed("value")
enabled: {
get(value) {
if (isEmpty(value)) {
2018-06-15 23:03:24 +08:00
return false;
}
return value.toString() === "true";
},
set(value) {
this.set("value", value ? "true" : "false");
return value;
}
2018-06-15 23:03:24 +08:00
}
});