Skip to content
This repository has been archived by the owner on Feb 23, 2024. It is now read-only.

Commit

Permalink
Only count error notices
Browse files Browse the repository at this point in the history
  • Loading branch information
Aljullu committed Oct 20, 2020
1 parent 10d126e commit 8be2654
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions assets/js/base/context/cart-checkout/checkout-state/index.js
Expand Up @@ -263,11 +263,17 @@ export const CheckoutStateProvider = ( {
dispatch( actions.setIdle() );
}
} else {
if (
checkoutNotices.length === 0 &&
expressPaymentNotices.length === 0 &&
paymentNotices.length === 0
) {
const hasErrorNotices =
checkoutNotices.some(
( notice ) => notice.status === 'error'
) ||
expressPaymentNotices.some(
( notice ) => notice.status === 'error'
) ||
paymentNotices.some(
( notice ) => notice.status === 'error'
);
if ( ! hasErrorNotices ) {
// no error handling in place by anything so let's fall
// back to default
const message =
Expand Down

0 comments on commit 8be2654

Please sign in to comment.