Skip to content

Commit

Permalink
Add a submit in progress check
Browse files Browse the repository at this point in the history
  • Loading branch information
lyyder committed Jul 9, 2018
1 parent dd55956 commit 7dd6db1
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/forms/StripePaymentForm/StripePaymentForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ class StripePaymentForm extends Component {
const classes = classNames(rootClassName || css.root, className);
const cardClasses = classNames(css.card, {
[css.cardSuccess]: this.state.cardValueValid,
[css.cardError]: this.state.error,
[css.cardError]: this.state.error && !submitInProgress,
});

const messagePlaceholder = intl.formatMessage(
Expand Down Expand Up @@ -240,7 +240,9 @@ class StripePaymentForm extends Component {
this.cardContainer = el;
}}
/>
{this.state.error ? <span style={{ color: 'red' }}>{this.state.error}</span> : null}
{this.state.error && !submitInProgress ? (
<span style={{ color: 'red' }}>{this.state.error}</span>
) : null}
<h3 className={css.messageHeading}>
<FormattedMessage id="StripePaymentForm.messageHeading" />
</h3>
Expand Down

0 comments on commit 7dd6db1

Please sign in to comment.