@anker-in/shopify-react 1.2.2-beta.1 → 1.2.2-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/hooks/index.js.map +1 -1
- package/dist/hooks/index.mjs.map +1 -1
- package/dist/index.js +5 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +5 -2
- package/dist/index.mjs.map +1 -1
- package/dist/provider/index.js +5 -2
- package/dist/provider/index.js.map +1 -1
- package/dist/provider/index.mjs +5 -2
- package/dist/provider/index.mjs.map +1 -1
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -3599,6 +3599,9 @@ function CartProvider({
|
|
|
3599
3599
|
const filteredSameCommonAttributes = commonAttributes.filter(
|
|
3600
3600
|
(attr) => !customAttributes.some((a) => a.key === attr.key)
|
|
3601
3601
|
);
|
|
3602
|
+
const attributesNeedRemove = customAttributesNeedRemove.filter(
|
|
3603
|
+
((attribute) => !customAttributes.find((a) => a.key === attribute.key))
|
|
3604
|
+
);
|
|
3602
3605
|
const newAttributes = [
|
|
3603
3606
|
...filteredSameCommonAttributes,
|
|
3604
3607
|
...customAttributes
|
|
@@ -3606,10 +3609,10 @@ function CartProvider({
|
|
|
3606
3609
|
const needUpdate = cart && checkAttributesUpdateNeeded(
|
|
3607
3610
|
cart.customAttributes,
|
|
3608
3611
|
newAttributes,
|
|
3609
|
-
|
|
3612
|
+
attributesNeedRemove
|
|
3610
3613
|
);
|
|
3611
3614
|
const finalAttributes = newAttributes.filter(
|
|
3612
|
-
(attribute) => !
|
|
3615
|
+
(attribute) => !attributesNeedRemove.find((a) => a.key === attribute.key)
|
|
3613
3616
|
);
|
|
3614
3617
|
if (needUpdate) {
|
|
3615
3618
|
return updateAttributes({ attributes: finalAttributes });
|