@betterstore/react 0.3.11 → 0.3.12

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/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @betterstore/sdk
2
2
 
3
+ ## 0.3.12
4
+
5
+ ### Patch Changes
6
+
7
+ - bug fix
8
+
3
9
  ## 0.3.11
4
10
 
5
11
  ### Patch Changes
package/dist/index.cjs.js CHANGED
@@ -35878,15 +35878,17 @@ function CheckoutEmbed({ checkoutId, config }) {
35878
35878
  };
35879
35879
  }, [checkoutId]); // Only re-run if checkoutId changes
35880
35880
  const onSuccess = () => {
35881
- setStep("customer");
35882
- setFormData({ customer: formData.customer });
35881
+ // Update store state directly without triggering UI updates
35882
+ useFormStore.getState().setStep("customer");
35883
+ useFormStore.getState().setFormData({ customer: formData.customer });
35883
35884
  if (successUrl) {
35884
35885
  window.location.href = successUrl;
35885
35886
  }
35886
35887
  };
35887
35888
  const onCancel = () => {
35888
- setStep("customer");
35889
- setFormData({ customer: formData.customer });
35889
+ // Update store state directly without triggering UI updates
35890
+ useFormStore.getState().setStep("customer");
35891
+ useFormStore.getState().setFormData({ customer: formData.customer });
35890
35892
  if (cancelUrl) {
35891
35893
  window.location.href = cancelUrl;
35892
35894
  }
@@ -35909,7 +35911,6 @@ function CheckoutEmbed({ checkoutId, config }) {
35909
35911
  setCheckout(newCheckout);
35910
35912
  });
35911
35913
  const removeDiscount = (id) => __awaiter(this, void 0, void 0, function* () {
35912
- console.log("storeclient method", storeClient);
35913
35914
  const newCheckout = yield storeClient.removeDiscount(clientSecret, checkoutId, id);
35914
35915
  setCheckout(newCheckout);
35915
35916
  });
package/dist/index.mjs CHANGED
@@ -35855,15 +35855,17 @@ function CheckoutEmbed({ checkoutId, config }) {
35855
35855
  };
35856
35856
  }, [checkoutId]); // Only re-run if checkoutId changes
35857
35857
  const onSuccess = () => {
35858
- setStep("customer");
35859
- setFormData({ customer: formData.customer });
35858
+ // Update store state directly without triggering UI updates
35859
+ useFormStore.getState().setStep("customer");
35860
+ useFormStore.getState().setFormData({ customer: formData.customer });
35860
35861
  if (successUrl) {
35861
35862
  window.location.href = successUrl;
35862
35863
  }
35863
35864
  };
35864
35865
  const onCancel = () => {
35865
- setStep("customer");
35866
- setFormData({ customer: formData.customer });
35866
+ // Update store state directly without triggering UI updates
35867
+ useFormStore.getState().setStep("customer");
35868
+ useFormStore.getState().setFormData({ customer: formData.customer });
35867
35869
  if (cancelUrl) {
35868
35870
  window.location.href = cancelUrl;
35869
35871
  }
@@ -35886,7 +35888,6 @@ function CheckoutEmbed({ checkoutId, config }) {
35886
35888
  setCheckout(newCheckout);
35887
35889
  });
35888
35890
  const removeDiscount = (id) => __awaiter(this, void 0, void 0, function* () {
35889
- console.log("storeclient method", storeClient);
35890
35891
  const newCheckout = yield storeClient.removeDiscount(clientSecret, checkoutId, id);
35891
35892
  setCheckout(newCheckout);
35892
35893
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@betterstore/react",
3
- "version": "0.3.11",
3
+ "version": "0.3.12",
4
4
  "description": "E-commerce for Developers",
5
5
  "private": false,
6
6
  "publishConfig": {