From b13a6e820bf00930f3ae2e214ccf7cb17a082aa3 Mon Sep 17 00:00:00 2001 From: Alexandre Segura Date: Thu, 5 Dec 2024 12:27:58 +0100 Subject: [PATCH] Do not corrupt Redux state. Fixes #1925. --- src/redux/Checkout/actions.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/redux/Checkout/actions.js b/src/redux/Checkout/actions.js index a4a599397..b5f9cac6f 100644 --- a/src/redux/Checkout/actions.js +++ b/src/redux/Checkout/actions.js @@ -1897,7 +1897,11 @@ export function setPaymentMethod(paymentMethod, cb) { }, ) .then(res => { - dispatch(updateCartSuccess(res)); + // We update the state with the same cart + // We can't use response, because it's not a cart + // TODO Use the payments returned + // https://github.com/coopcycle/coopcycle-app/issues/1925 + dispatch(updateCartSuccess(cart)); cb() }) .catch(e => dispatch(checkoutFailure(e)));