From b2cdc1c29e9b44654001454c72b298b5c7d1009b Mon Sep 17 00:00:00 2001 From: Faizaan Gagan Date: Sat, 16 Jan 2021 17:27:38 +0530 Subject: [PATCH] REFACTOR: used new syntax for computed property --- .../wizard/initializers/custom-wizard-field.js.es6 | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/assets/javascripts/wizard/initializers/custom-wizard-field.js.es6 b/assets/javascripts/wizard/initializers/custom-wizard-field.js.es6 index 7202432e..a520f5dd 100644 --- a/assets/javascripts/wizard/initializers/custom-wizard-field.js.es6 +++ b/assets/javascripts/wizard/initializers/custom-wizard-field.js.es6 @@ -1,4 +1,5 @@ import { dasherize } from "@ember/string"; +import discourseComputed from "discourse-common/utils/decorators"; export default { name: "custom-wizard-field", @@ -15,9 +16,10 @@ export default { FieldComponent.reopen({ classNameBindings: ["field.id"], - textType: function() { - return ['text', 'textarea', 'composer'].includes(this.get('field.type')); - }.property("field.type"), + @discourseComputed("field.type") + textType(fieldType) { + return ['text', 'textarea', 'composer'].includes(fieldType); + }, cookedDescription: function () { return cook(this.get("field.description"));