From 8b3487f9f9118dc090bd0e55154ba430fb946d8a Mon Sep 17 00:00:00 2001 From: merino Date: Thu, 12 Dec 2024 18:46:10 +0100 Subject: [PATCH] Display the ServerError container when the place order fails --- blocks/commerce-checkout/commerce-checkout.js | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/blocks/commerce-checkout/commerce-checkout.js b/blocks/commerce-checkout/commerce-checkout.js index 31af61652..a20ba410e 100644 --- a/blocks/commerce-checkout/commerce-checkout.js +++ b/blocks/commerce-checkout/commerce-checkout.js @@ -390,11 +390,7 @@ export default async function decorate(block) { handlePlaceOrder: async ({ cartId }) => { await displayOverlaySpinner(); - orderApi.placeOrder(cartId) - .catch(console.error) - .finally(() => { - removeOverlaySpinner(); - }); + await orderApi.placeOrder(cartId).finally(removeOverlaySpinner); }, })($placeOrder), ]);