@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.mjs
CHANGED
|
@@ -1630,29 +1630,22 @@ var useUpdateLineCodeAmountAttributes = ({
|
|
|
1630
1630
|
}).filter(
|
|
1631
1631
|
({ attrNeedUpdate, attrNeedDelete }) => attrNeedUpdate.length || attrNeedDelete.length
|
|
1632
1632
|
).map(({ line, attrNeedUpdate, attrNeedDelete }) => {
|
|
1633
|
+
let lineId = line.id;
|
|
1634
|
+
let attributes = line.customAttributes || [];
|
|
1635
|
+
if (attrNeedDelete.length) {
|
|
1636
|
+
attributes = attributes.filter(
|
|
1637
|
+
(attr) => !attrNeedDelete.includes(attr.key)
|
|
1638
|
+
);
|
|
1639
|
+
}
|
|
1633
1640
|
if (attrNeedUpdate.length) {
|
|
1634
|
-
|
|
1635
|
-
|
|
1636
|
-
|
|
1637
|
-
...line.customAttributes?.filter(
|
|
1638
|
-
(attr) => !attrNeedUpdate.some((updateAttr) => updateAttr.key === attr.key)
|
|
1639
|
-
) || [],
|
|
1640
|
-
...attrNeedUpdate
|
|
1641
|
-
]
|
|
1642
|
-
};
|
|
1643
|
-
} else if (attrNeedDelete.length) {
|
|
1644
|
-
return {
|
|
1645
|
-
id: line.id,
|
|
1646
|
-
attributes: line.customAttributes?.filter(
|
|
1647
|
-
(attr) => !attrNeedDelete.includes(attr.key)
|
|
1648
|
-
) || []
|
|
1649
|
-
};
|
|
1650
|
-
} else {
|
|
1651
|
-
return {
|
|
1652
|
-
id: line.id,
|
|
1653
|
-
attributes: line.customAttributes || []
|
|
1654
|
-
};
|
|
1641
|
+
attributes = attributes.filter(
|
|
1642
|
+
(attr) => !attrNeedUpdate.some((updateAttr) => updateAttr.key === attr.key)
|
|
1643
|
+
).concat(attrNeedUpdate);
|
|
1655
1644
|
}
|
|
1645
|
+
return {
|
|
1646
|
+
id: lineId,
|
|
1647
|
+
attributes
|
|
1648
|
+
};
|
|
1656
1649
|
}),
|
|
1657
1650
|
[cart?.lineItems, mainProductDiscountCodes]
|
|
1658
1651
|
);
|