diff --git a/CHANGELOG.md b/CHANGELOG.md index eded3df3..4b74ff52 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ## [Unreleased] +### Fixed + +- Change add to cart process to synchronous to avoid loss of data in some cases + ## [3.12.3] - 2022-11-23 ### Added diff --git a/react/UploadBlock.tsx b/react/UploadBlock.tsx index 5d5843a4..c56360dd 100644 --- a/react/UploadBlock.tsx +++ b/react/UploadBlock.tsx @@ -235,7 +235,8 @@ const UploadBlock: FunctionComponent< if (chunk.length) { const currentItemsInCart = orderForm.orderForm.items - const mutationChunk = addToCart({ + // eslint-disable-next-line no-await-in-loop + const mutationChunk = await addToCart({ variables: { items: chunk.map((item: ItemType) => { const [existsInCurrentOrder] = currentItemsInCart.filter(