@anker-in/shopify-react 1.2.0-beta.4 → 1.2.0-beta.6

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.
@@ -1648,7 +1648,8 @@ var useUpdateLineCodeAmountAttributes = ({
1648
1648
  mutateCart,
1649
1649
  isCartLoading,
1650
1650
  setLoadingState,
1651
- metafieldIdentifiers
1651
+ metafieldIdentifiers,
1652
+ disabled = false
1652
1653
  }) => {
1653
1654
  const { client, cartCookieAdapter } = useShopify();
1654
1655
  const mainProductDiscountCodes = useMemo(
@@ -1726,7 +1727,7 @@ var useUpdateLineCodeAmountAttributes = ({
1726
1727
  );
1727
1728
  const { loading } = useRequest(
1728
1729
  async () => {
1729
- if (linesNeedUpdate?.length && !isCartLoading) {
1730
+ if (linesNeedUpdate?.length && !isCartLoading && !disabled) {
1730
1731
  const result = await updateCartLines(client, {
1731
1732
  cartId: cart?.id || "",
1732
1733
  lines: linesNeedUpdate,
@@ -1742,7 +1743,7 @@ var useUpdateLineCodeAmountAttributes = ({
1742
1743
  throttleWait: 3e3,
1743
1744
  // 3 秒内只触发最后一次更新
1744
1745
  throttleTrailing: true,
1745
- refreshDeps: [linesNeedUpdate, isCartLoading]
1746
+ refreshDeps: [linesNeedUpdate, isCartLoading, disabled]
1746
1747
  }
1747
1748
  );
1748
1749
  useEffect(() => {