fix: challenge modal logic
This commit is contained in:
@@ -109,11 +109,11 @@ class ChallengeModalCtrl extends PureViewCtrl<{}, ChallengeModalState> {
|
|||||||
this.getState().values[value.prompt.id]!.invalid = true;
|
this.getState().values[value.prompt.id]!.invalid = true;
|
||||||
/** If custom validation, treat all values together and not individually */
|
/** If custom validation, treat all values together and not individually */
|
||||||
if (!value.prompt.validates) {
|
if (!value.prompt.validates) {
|
||||||
this.setState({ processingPrompts: [] });
|
this.setState({ processingPrompts: [], processing: false });
|
||||||
} else {
|
} else {
|
||||||
removeFromArray(this.state.processingPrompts, value.prompt);
|
removeFromArray(this.state.processingPrompts, value.prompt);
|
||||||
|
this.reloadProcessingStatus();
|
||||||
}
|
}
|
||||||
this.reloadProcessingStatus();
|
|
||||||
},
|
},
|
||||||
onComplete: () => {
|
onComplete: () => {
|
||||||
this.dismiss();
|
this.dismiss();
|
||||||
@@ -192,9 +192,6 @@ class ChallengeModalCtrl extends PureViewCtrl<{}, ChallengeModalState> {
|
|||||||
await this.setState({ processing: true });
|
await this.setState({ processing: true });
|
||||||
const values: ChallengeValue[] = [];
|
const values: ChallengeValue[] = [];
|
||||||
for (const inputValue of Object.values(this.getState().values)) {
|
for (const inputValue of Object.values(this.getState().values)) {
|
||||||
if (inputValue!.invalid) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
const rawValue = inputValue!!.value;
|
const rawValue = inputValue!!.value;
|
||||||
const value = new ChallengeValue(inputValue!.prompt, rawValue);
|
const value = new ChallengeValue(inputValue!.prompt, rawValue);
|
||||||
values.push(value);
|
values.push(value);
|
||||||
|
|||||||
Reference in New Issue
Block a user