2
0
Fork 0
mirror of https://github.com/discourse/discourse.git synced 2025-09-06 10:50:21 +08:00

FIX: Debounce group name validation correctly (#13757)

This commit is contained in:
Osama Sayegh 2021-07-16 05:51:13 +03:00 committed by GitHub
parent 8bdec18d58
commit 7323c65d53
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -57,17 +57,18 @@ export default Component.extend({
);
}
this.checkGroupName();
this.checkGroupNameDebounced();
return this._failedInputValidation(
I18n.t("admin.groups.new.name.checking")
);
},
checkGroupName() {
discourseDebounce(
this,
function () {
checkGroupNameDebounced() {
discourseDebounce(this, this._checkGroupName, 500);
},
_checkGroupName() {
if (isEmpty(this.nameInput)) {
return;
}
@ -101,9 +102,6 @@ export default Component.extend({
})
.catch(popupAjaxError);
},
500
);
},
_failedInputValidation(reason) {
this.set("disableSave", true);