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

Commit

Permalink
Make notices speak when shown
Browse files Browse the repository at this point in the history
  • Loading branch information
opr committed Dec 13, 2022
1 parent 74e372f commit b92395d
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions assets/js/data/cart/notify-quantity-changes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,15 @@ const notifyIfQuantityLimitsChanged = ( oldCart: Cart, newCart: Cart ) => {
),
{
context: 'wc/cart',
speak: true,
type: 'snackbar',
id: `${ cartItem.key }-quantity-update`,
}
);
return;
}

// Quantity is above max, so has been reduced.
dispatch( 'core/notices' ).createInfoNotice(
sprintf(
/* translators: %1$s is the name of the item, %2$d is the quantity of the item. */
Expand All @@ -62,6 +65,7 @@ const notifyIfQuantityLimitsChanged = ( oldCart: Cart, newCart: Cart ) => {
),
{
context: 'wc/cart',
speak: true,
type: 'snackbar',
id: `${ cartItem.key }-quantity-update`,
}
Expand Down Expand Up @@ -98,6 +102,7 @@ const notifyIfQuantityChanged = (
),
{
context: 'wc/cart',
speak: true,
type: 'snackbar',
id: `${ cartItem.key }-quantity-update`,
}
Expand Down

0 comments on commit b92395d

Please sign in to comment.