@anker-in/shopify-react 0.1.1-beta.23 → 0.1.1-beta.24
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 +14 -21
- package/dist/hooks/index.js.map +1 -1
- package/dist/hooks/index.mjs +14 -21
- package/dist/hooks/index.mjs.map +1 -1
- package/dist/index.js +14 -21
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +14 -21
- package/dist/index.mjs.map +1 -1
- package/dist/provider/index.js +14 -21
- package/dist/provider/index.js.map +1 -1
- package/dist/provider/index.mjs +14 -21
- package/dist/provider/index.mjs.map +1 -1
- package/package.json +3 -3
package/dist/hooks/index.js
CHANGED
|
@@ -1639,29 +1639,22 @@ var useUpdateLineCodeAmountAttributes = ({
|
|
|
1639
1639
|
}).filter(
|
|
1640
1640
|
({ attrNeedUpdate, attrNeedDelete }) => attrNeedUpdate.length || attrNeedDelete.length
|
|
1641
1641
|
).map(({ line, attrNeedUpdate, attrNeedDelete }) => {
|
|
1642
|
+
let lineId = line.id;
|
|
1643
|
+
let attributes = line.customAttributes || [];
|
|
1644
|
+
if (attrNeedDelete.length) {
|
|
1645
|
+
attributes = attributes.filter(
|
|
1646
|
+
(attr) => !attrNeedDelete.includes(attr.key)
|
|
1647
|
+
);
|
|
1648
|
+
}
|
|
1642
1649
|
if (attrNeedUpdate.length) {
|
|
1643
|
-
|
|
1644
|
-
|
|
1645
|
-
|
|
1646
|
-
...line.customAttributes?.filter(
|
|
1647
|
-
(attr) => !attrNeedUpdate.some((updateAttr) => updateAttr.key === attr.key)
|
|
1648
|
-
) || [],
|
|
1649
|
-
...attrNeedUpdate
|
|
1650
|
-
]
|
|
1651
|
-
};
|
|
1652
|
-
} else if (attrNeedDelete.length) {
|
|
1653
|
-
return {
|
|
1654
|
-
id: line.id,
|
|
1655
|
-
attributes: line.customAttributes?.filter(
|
|
1656
|
-
(attr) => !attrNeedDelete.includes(attr.key)
|
|
1657
|
-
) || []
|
|
1658
|
-
};
|
|
1659
|
-
} else {
|
|
1660
|
-
return {
|
|
1661
|
-
id: line.id,
|
|
1662
|
-
attributes: line.customAttributes || []
|
|
1663
|
-
};
|
|
1650
|
+
attributes = attributes.filter(
|
|
1651
|
+
(attr) => !attrNeedUpdate.some((updateAttr) => updateAttr.key === attr.key)
|
|
1652
|
+
).concat(attrNeedUpdate);
|
|
1664
1653
|
}
|
|
1654
|
+
return {
|
|
1655
|
+
id: lineId,
|
|
1656
|
+
attributes
|
|
1657
|
+
};
|
|
1665
1658
|
}),
|
|
1666
1659
|
[cart?.lineItems, mainProductDiscountCodes]
|
|
1667
1660
|
);
|