discourse/app/assets/javascripts/admin/addon/components/site-settings/bool.js
David Taylor 48193767bf DEV: Sort imports
Automatically generated by `eslint --fix` to satisfy the updated configuration
2023-10-10 21:46:54 +01:00

19 lines
413 B
JavaScript

import Component from "@ember/component";
import { computed } from "@ember/object";
import { isEmpty } from "@ember/utils";
export default class Bool extends Component {
@computed("value")
get enabled() {
if (isEmpty(this.value)) {
return false;
}
return this.value.toString() === "true";
}
set enabled(value) {
this.set("value", value ? "true" : "false");
return value;
}
}