mirror of
https://github.com/scratchfoundation/scratch-www.git
synced 2025-02-17 08:31:23 -05:00
Don’t validate username server side if error
Fixes #1097 by not making the server-side username validation call if the client side validations have failed. This is not the ideal way to do this, since it’s getting the input from an array. However, to make this different would require significant refactor.
This commit is contained in:
parent
e763f8a9bf
commit
5da9514f4d
1 changed files with 4 additions and 1 deletions
|
@ -136,7 +136,9 @@ module.exports = {
|
|||
}.bind(this));
|
||||
},
|
||||
onUsernameBlur: function (event) {
|
||||
this.validateUsername(event.currentTarget.value);
|
||||
if (this.refs.form.refs.formsy.inputs[0].isValidValue(event.currentTarget.value)) {
|
||||
this.validateUsername(event.currentTarget.value);
|
||||
}
|
||||
},
|
||||
onValidSubmit: function (formData) {
|
||||
this.setState({waiting: true});
|
||||
|
@ -183,6 +185,7 @@ module.exports = {
|
|||
<Input className={this.state.validUsername}
|
||||
type="text"
|
||||
name="user.username"
|
||||
ref="thing"
|
||||
onBlur={this.onUsernameBlur}
|
||||
validations={{
|
||||
matchRegexp: /^[\w-]*$/,
|
||||
|
|
Loading…
Reference in a new issue