mirror of
https://github.com/discourse/discourse.git
synced 2024-11-24 06:51:04 +08:00
REFACTOR: removes use of undeclared variable (#9682)
This commit is contained in:
parent
af78d188b8
commit
9846c43d93
|
@ -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";
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user