diff --git a/src/pages/EnablePayments/TermsStep.js b/src/pages/EnablePayments/TermsStep.js index 674ecf09a2b7..823c61739649 100644 --- a/src/pages/EnablePayments/TermsStep.js +++ b/src/pages/EnablePayments/TermsStep.js @@ -45,14 +45,22 @@ class TermsStep extends React.Component { }; } + clearError() { + if (!this.state.hasAcceptedDisclosure || !this.state.hasAcceptedPrivacyPolicyAndWalletAgreement) { + return; + } + + this.setState({error: false}); + } + toggleDisclosure() { - this.setState(prevState => ({hasAcceptedDisclosure: !prevState.hasAcceptedDisclosure})); + this.setState(prevState => ({hasAcceptedDisclosure: !prevState.hasAcceptedDisclosure}), () => this.clearError()); } togglePrivacyPolicy() { this.setState(prevState => ({ hasAcceptedPrivacyPolicyAndWalletAgreement: !prevState.hasAcceptedPrivacyPolicyAndWalletAgreement, - })); + }), () => this.clearError()); } render() {