mirror of
https://github.com/oceanprotocol/commons.git
synced 2023-03-15 18:03:00 +01:00
run validation as a callback to first state updates
This commit is contained in:
parent
9069947ca1
commit
38d0b0ae01
@ -118,7 +118,6 @@ class Publish extends Component<{}, PublishState> {
|
||||
}
|
||||
|
||||
private validateInputs = (name: string, value: any) => {
|
||||
let { validationStatus } = this.state
|
||||
let hasContent = value.length > 0
|
||||
|
||||
// Setting state for all fields
|
||||
@ -131,7 +130,7 @@ class Publish extends Component<{}, PublishState> {
|
||||
[name]: true
|
||||
}
|
||||
}
|
||||
}))
|
||||
}), this.runValidation)
|
||||
} else {
|
||||
this.setState(prevState => ({
|
||||
validationStatus: {
|
||||
@ -141,9 +140,12 @@ class Publish extends Component<{}, PublishState> {
|
||||
[name]: false
|
||||
}
|
||||
}
|
||||
}))
|
||||
}), this.runValidation)
|
||||
}
|
||||
}
|
||||
|
||||
private runValidation = () => {
|
||||
let { validationStatus } = this.state
|
||||
//
|
||||
// Step 1
|
||||
//
|
||||
|
Loading…
Reference in New Issue
Block a user