From ee613d74c8aced405faec06024429d29b915cf74 Mon Sep 17 00:00:00 2001 From: Faizaan Gagan Date: Thu, 25 Mar 2021 11:30:57 +0530 Subject: [PATCH] minor fix --- .../wizard/components/similar-topics-validator.js.es6 | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/assets/javascripts/wizard/components/similar-topics-validator.js.es6 b/assets/javascripts/wizard/components/similar-topics-validator.js.es6 index eae1ae63..6081fdfa 100644 --- a/assets/javascripts/wizard/components/similar-topics-validator.js.es6 +++ b/assets/javascripts/wizard/components/similar-topics-validator.js.es6 @@ -4,7 +4,7 @@ import { observes } from "discourse-common/utils/decorators"; import { cancel, later } from "@ember/runloop"; import { A } from "@ember/array"; import EmberObject, { computed } from "@ember/object"; -import { notEmpty, and, equal, empty, alias } from "@ember/object/computed"; +import { notEmpty, and, equal, empty } from "@ember/object/computed"; import discourseComputed from "discourse-common/utils/decorators"; import { categoryBadgeHTML } from "discourse/helpers/category-link"; import { dasherize } from "@ember/string"; @@ -12,8 +12,7 @@ import { dasherize } from "@ember/string"; export default WizardFieldValidator.extend({ classNames: ['similar-topics-validator'], similarTopics: null, - input: alias('field.value'), - hasInput: notEmpty('input'), + hasInput: notEmpty('field.value'), hasSimilarTopics: notEmpty('similarTopics'), hasNotSearched: equal('similarTopics', null), noSimilarTopics: computed('similarTopics', function() { @@ -22,8 +21,8 @@ export default WizardFieldValidator.extend({ showDefault: computed('hasNotSearched', 'hasInput', 'typing', function() { return this.hasInput && (this.hasNotSearched || this.typing); }), - insufficientCharacters: computed('typing', 'input', function() { - return this.hasInput && this.input.length < 5 && !this.typing; + insufficientCharacters: computed('typing', 'field.value', function() { + return this.hasInput && this.field.value.length < 5 && !this.typing; }), showSimilarTopics: computed('typing', 'hasSimilarTopics', function() { return this.hasSimilarTopics && !this.typing;