mirror of
https://github.com/discourse/discourse.git
synced 2024-11-29 03:45:56 +08:00
a433b30650
This conversion was achieved using the ember-native-class-codemod, plus a handful of manual fixes/tweaks
19 lines
413 B
JavaScript
19 lines
413 B
JavaScript
import { computed } from "@ember/object";
|
|
import Component from "@ember/component";
|
|
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;
|
|
}
|
|
}
|