@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/provider/index.mjs
CHANGED
|
@@ -1234,6 +1234,9 @@ function CartProvider({
|
|
|
1234
1234
|
const filteredSameCommonAttributes = commonAttributes.filter(
|
|
1235
1235
|
(attr) => !customAttributes.some((a) => a.key === attr.key)
|
|
1236
1236
|
);
|
|
1237
|
+
const attributesNeedRemove = customAttributesNeedRemove.filter(
|
|
1238
|
+
((attribute) => !customAttributes.find((a) => a.key === attribute.key))
|
|
1239
|
+
);
|
|
1237
1240
|
const newAttributes = [
|
|
1238
1241
|
...filteredSameCommonAttributes,
|
|
1239
1242
|
...customAttributes
|
|
@@ -1241,10 +1244,10 @@ function CartProvider({
|
|
|
1241
1244
|
const needUpdate = cart && checkAttributesUpdateNeeded(
|
|
1242
1245
|
cart.customAttributes,
|
|
1243
1246
|
newAttributes,
|
|
1244
|
-
|
|
1247
|
+
attributesNeedRemove
|
|
1245
1248
|
);
|
|
1246
1249
|
const finalAttributes = newAttributes.filter(
|
|
1247
|
-
(attribute) => !
|
|
1250
|
+
(attribute) => !attributesNeedRemove.find((a) => a.key === attribute.key)
|
|
1248
1251
|
);
|
|
1249
1252
|
if (needUpdate) {
|
|
1250
1253
|
return updateAttributes({ attributes: finalAttributes });
|