Skip to content

Commit

Permalink
fix: challenge modal logic
Browse files Browse the repository at this point in the history
  • Loading branch information
moughxyz committed Sep 22, 2020
1 parent 8cec60f commit f6fb245
Showing 1 changed file with 2 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -109,11 +109,11 @@ class ChallengeModalCtrl extends PureViewCtrl<{}, ChallengeModalState> {
this.getState().values[value.prompt.id]!.invalid = true;
/** If custom validation, treat all values together and not individually */
if (!value.prompt.validates) {
this.setState({ processingPrompts: [] });
this.setState({ processingPrompts: [], processing: false });
} else {
removeFromArray(this.state.processingPrompts, value.prompt);
this.reloadProcessingStatus();
}
this.reloadProcessingStatus();
},
onComplete: () => {
this.dismiss();
Expand Down Expand Up @@ -192,9 +192,6 @@ class ChallengeModalCtrl extends PureViewCtrl<{}, ChallengeModalState> {
await this.setState({ processing: true });
const values: ChallengeValue[] = [];
for (const inputValue of Object.values(this.getState().values)) {
if (inputValue!.invalid) {
continue;
}
const rawValue = inputValue!!.value;
const value = new ChallengeValue(inputValue!.prompt, rawValue);
values.push(value);
Expand Down

0 comments on commit f6fb245

Please sign in to comment.