REFACTOR: removes use of undeclared variable (#9682)

REFACTOR: removes use of undeclared variable (#9682)

diff --git a/app/assets/javascripts/discourse/app/components/groups-form-profile-fields.js b/app/assets/javascripts/discourse/app/components/groups-form-profile-fields.js
index 988e4ac..39077b9 100644
--- a/app/assets/javascripts/discourse/app/components/groups-form-profile-fields.js
+++ b/app/assets/javascripts/discourse/app/components/groups-form-profile-fields.js
@@ -31,25 +31,24 @@ export default Component.extend({
 
   @observes("nameInput")
   _validateName() {
-    name = this.nameInput;
-    if (name === this.get("model.name")) return;
+    if (this.nameInput === this.get("model.name")) return;
 
-    if (name === undefined) {
+    if (this.nameInput === undefined) {
       return this._failedInputValidation();
     }
 
-    if (name === "") {
+    if (this.nameInput === "") {
       this.set("uniqueNameValidation", null);
       return this._failedInputValidation(I18n.t("admin.groups.new.name.blank"));
     }
 
-    if (name.length < this.siteSettings.min_username_length) {
+    if (this.nameInput.length < this.siteSettings.min_username_length) {
       return this._failedInputValidation(
         I18n.t("admin.groups.new.name.too_short")
       );
     }
 
-    if (name.length > this.siteSettings.max_username_length) {
+    if (this.nameInput.length > this.siteSettings.max_username_length) {
       return this._failedInputValidation(
         I18n.t("admin.groups.new.name.too_long")
       );
@@ -63,10 +62,9 @@ export default Component.extend({
   },
 
   checkGroupName: discourseDebounce(function() {
-    name = this.nameInput;
-    if (isEmpty(name)) return;
+    if (isEmpty(this.nameInput)) return;
 
-    Group.checkName(name)
+    Group.checkName(this.nameInput)
       .then(response => {
         const validationName = "uniqueNameValidation";
 

GitHub sha: 9846c43d

This commit appears in #9682 which was approved by eviltrout. It was merged by jjaffeux.