From f6fb24508ea5df93ca5172c7f9627c8ed0232e74 Mon Sep 17 00:00:00 2001 From: Mo Bitar Date: Tue, 22 Sep 2020 11:56:14 -0500 Subject: [PATCH] fix: challenge modal logic --- .../javascripts/views/challenge_modal/challenge_modal.ts | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/app/assets/javascripts/views/challenge_modal/challenge_modal.ts b/app/assets/javascripts/views/challenge_modal/challenge_modal.ts index c51abd7a5..d73dc415e 100644 --- a/app/assets/javascripts/views/challenge_modal/challenge_modal.ts +++ b/app/assets/javascripts/views/challenge_modal/challenge_modal.ts @@ -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(); @@ -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);