1
0
mirror of synced 2024-11-22 05:16:05 +03:00

refactor: pendingValidation renamed to validationRun

This commit is contained in:
Zaytsev Kirill 2020-10-26 00:41:28 +03:00
parent 7b5d38923f
commit 91a97e4365

View File

@ -63,7 +63,7 @@ export default class FormularioInput extends Vue {
private localErrors: string[] = []
private violations: Violation[] = []
private pendingValidation: Promise<any> = Promise.resolve()
private validationRun: Promise<any> = Promise.resolve()
get fullQualifiedName (): string {
return this.path !== '' ? `${this.path}.${this.name}` : this.name
@ -193,7 +193,7 @@ export default class FormularioInput extends Vue {
}
runValidation (): Promise<void> {
this.pendingValidation = this.validate().then(violations => {
this.validationRun = this.validate().then(violations => {
const validationChanged = !shallowEqualObjects(violations, this.violations)
this.violations = violations
if (validationChanged) {
@ -209,7 +209,7 @@ export default class FormularioInput extends Vue {
return this.violations
})
return this.pendingValidation
return this.validationRun
}
validate (): Promise<Violation[]> {
@ -227,7 +227,7 @@ export default class FormularioInput extends Vue {
hasValidationErrors (): Promise<boolean> {
return new Promise(resolve => {
this.$nextTick(() => {
this.pendingValidation.then(() => resolve(this.violations.length > 0))
this.validationRun.then(() => resolve(this.violations.length > 0))
})
})
}