From 25f6c82ba1165b145d6a969b7ef38c655c4e2f16 Mon Sep 17 00:00:00 2001 From: Alex Rowley Date: Thu, 3 Dec 2020 01:51:21 +0000 Subject: [PATCH 1/4] Revert "Reset cart quantity to 0 if we get a 404 for the cart" This reverts commit caa1b30580f1a3c527de5d9b499d168c4cb96e86. This will now be handled upstream in stencil-utils as a 404 is not an err from fetch https://github.com/github/fetch/issues/155 --- assets/js/theme/global/cart-preview.js | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/assets/js/theme/global/cart-preview.js b/assets/js/theme/global/cart-preview.js index 0fc5138c7d..70e3c05789 100644 --- a/assets/js/theme/global/cart-preview.js +++ b/assets/js/theme/global/cart-preview.js @@ -77,12 +77,7 @@ export default function (secureBaseUrl, cartId) { const cartQtyPromise = new Promise((resolve, reject) => { utils.api.cart.getCartQuantity({ baseUrl: secureBaseUrl, cartId }, (err, qty) => { if (err) { - // If this appears to be a 404 for the cart ID, set cart quantity to 0 - if (err === 'Not Found') { - resolve(0); - } else { - reject(err); - } + reject(err); } resolve(qty); }); From 1a9a80c42fb4b45001bbacded00a3b6200aa82e3 Mon Sep 17 00:00:00 2001 From: Alex Rowley Date: Thu, 3 Dec 2020 12:05:40 +0000 Subject: [PATCH 2/4] bump usage of stencil-utils to 6.7.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 2743dc0235..d147363d50 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,7 @@ "author": "BigCommerce", "license": "MIT", "dependencies": { - "@bigcommerce/stencil-utils": "^6.6.0", + "@bigcommerce/stencil-utils": "^6.7.0", "core-js": "^3.6.5", "creditcards": "^3.0.1", "easyzoom": "^2.5.3", From fb5ff01d491553e6d3d1dac99e405de1e6c73f91 Mon Sep 17 00:00:00 2001 From: Alex Rowley Date: Thu, 10 Dec 2020 00:01:50 +0000 Subject: [PATCH 3/4] update lock file to include stencil-utils 6.7.0 --- package-lock.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index debbf0a667..930423abb7 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1436,9 +1436,9 @@ "dev": true }, "@bigcommerce/stencil-utils": { - "version": "6.6.0", - "resolved": "https://registry.npmjs.org/@bigcommerce/stencil-utils/-/stencil-utils-6.6.0.tgz", - "integrity": "sha512-KTWCqxadm8enfSGQQwAbHqB9hxRGCdEyXpLwS1VDr79AaHTYmtE8c7KiS42R3uq6h+x/F8qBvqsLPHXGkUm1Ng==", + "version": "6.7.0", + "resolved": "https://registry.npmjs.org/@bigcommerce/stencil-utils/-/stencil-utils-6.7.0.tgz", + "integrity": "sha512-E7hRXntTQzAg/wCQxCxYtadeWcoMNPxQKzMFKrrxcbnb+5KGW6M8U/IrhJNkjEUnDsy/ukE4Ovr1kI8E5UyfVg==", "requires": { "eventemitter3": "^4.0.4", "whatwg-fetch": "^3.4.0" From f2d4bc6b50a7674997b4fb989090799bd7ce8246 Mon Sep 17 00:00:00 2001 From: Alex Rowley Date: Thu, 17 Jun 2021 11:17:16 +0100 Subject: [PATCH 4/4] Update CHANGELOG.md --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1ad4d1dbb4..2d28c0566c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,7 @@ # Changelog ## Draft +- Revert "Reset cart quantity to 0 if we get a 404 for the cart" [#1920](https://github.com/bigcommerce/cornerstone/pull/1920) ## 5.6.0 (06-15-2021) - Translation mechanism for config.json values have been implemented. [#2076](https://github.com/bigcommerce/cornerstone/pull/2076)