@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 +6 -0
- package/dist/index.cjs.js +6 -5
- package/dist/index.mjs +6 -5
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
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
|
-
|
|
35882
|
-
|
|
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
|
-
|
|
35889
|
-
|
|
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
|
-
|
|
35859
|
-
|
|
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
|
-
|
|
35866
|
-
|
|
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
|
});
|