@pelcro/react-pelcro-js 3.26.0-beta.73 → 3.26.0-beta.75

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/index.cjs.js CHANGED
@@ -9387,13 +9387,20 @@ class PelcroActions {
9387
9387
  console.error("invalid item SKU id");
9388
9388
  return false;
9389
9389
  }
9390
- const skusMatchingUserCurrency = window.Pelcro.ecommerce.products.getSkus();
9391
- const itemMatchesUserCurrency = skusMatchingUserCurrency.some(sku => sku.id === quickPurchaseItem.id);
9392
- if (!itemMatchesUserCurrency) {
9393
- const userCurrency = window.Pelcro.user.read().currency;
9394
- console.error(`SKU currency (${quickPurchaseItem.currency}) doesn't match user account's currency (${userCurrency}). users can only purchase SKUs that match their account's currency`);
9395
- return false;
9396
- }
9390
+ window.Pelcro.ecommerce.products.getSkus();
9391
+
9392
+ // const itemMatchesUserCurrency = skusMatchingUserCurrency.some(
9393
+ // (sku) => sku.id === quickPurchaseItem.id
9394
+ // );
9395
+
9396
+ // if (!itemMatchesUserCurrency) {
9397
+ // const userCurrency = window.Pelcro.user.read().currency;
9398
+ // console.error(
9399
+ // `SKU currency (${quickPurchaseItem.currency}) doesn't match user account's currency (${userCurrency}). users can only purchase SKUs that match their account's currency`
9400
+ // );
9401
+ // return false;
9402
+ // }
9403
+
9397
9404
  const quickPurchaseItemWithQuantity = {
9398
9405
  ...quickPurchaseItem,
9399
9406
  quantity: 1
@@ -11728,21 +11735,24 @@ const init$1 = () => {
11728
11735
  if (!quickPurchaseItem) {
11729
11736
  return console.error("invalid item SKU id");
11730
11737
  }
11731
- const purchaseResult = purchaseItem(itemSkuId);
11732
- const itemDidntMatchUserCurrency = purchaseResult === false;
11733
- if (itemDidntMatchUserCurrency) {
11734
- var _window$Pelcro$user$r;
11735
- const userCurrency = (_window$Pelcro$user$r = window.Pelcro.user.read().currency) === null || _window$Pelcro$user$r === void 0 ? void 0 : _window$Pelcro$user$r.toUpperCase();
11736
- const errorMsg = i18next.t("shop:messages.currencyMismatch", {
11737
- currency: userCurrency
11738
- });
11739
- notify.error(errorMsg);
11740
- }
11738
+ purchaseItem(itemSkuId);
11739
+
11740
+ // if (itemDidntMatchUserCurrency) {
11741
+ // const userCurrency = window.Pelcro.user
11742
+ // .read()
11743
+ // .currency?.toUpperCase();
11744
+ // const errorMsg = i18n.t(
11745
+ // "shop:messages.currencyMismatch",
11746
+ // { currency: userCurrency }
11747
+ // );
11748
+ // notify.error(errorMsg);
11749
+ // }
11741
11750
  });
11742
11751
  }
11743
11752
  }
11744
11753
  });
11745
11754
  };
11755
+
11746
11756
  const authenticatedButtons = () => {
11747
11757
  saveToMetadataButton.authenticated();
11748
11758
  const pelcroLoginByClass = document.getElementsByClassName("pelcro-login-button");
@@ -28837,23 +28847,21 @@ const CartContainer = _ref => {
28837
28847
  }
28838
28848
  });
28839
28849
  } else {
28840
- const userCurrency = window.Pelcro.user.read().currency;
28841
- const itemsCurrency = cartItems[0].currency;
28842
- if (userCurrency && userCurrency !== itemsCurrency) {
28843
- dispatch({
28844
- type: DISABLE_SUBMIT,
28845
- payload: true
28846
- });
28847
- dispatch({
28848
- type: SHOW_ALERT,
28849
- payload: {
28850
- type: "error",
28851
- content: t("messages.currencyMismatch", {
28852
- currency: userCurrency.toUpperCase()
28853
- })
28854
- }
28855
- });
28856
- }
28850
+ window.Pelcro.user.read().currency;
28851
+ cartItems[0].currency;
28852
+
28853
+ // if (userCurrency && userCurrency !== itemsCurrency) {
28854
+ // dispatch({ type: DISABLE_SUBMIT, payload: true });
28855
+ // dispatch({
28856
+ // type: SHOW_ALERT,
28857
+ // payload: {
28858
+ // type: "error",
28859
+ // content: t("messages.currencyMismatch", {
28860
+ // currency: userCurrency.toUpperCase()
28861
+ // })
28862
+ // }
28863
+ // });
28864
+ // }
28857
28865
  }
28858
28866
  }, [cartItems]);
28859
28867
  const submit = (state, dispatch) => {
package/dist/index.esm.js CHANGED
@@ -9357,13 +9357,20 @@ class PelcroActions {
9357
9357
  console.error("invalid item SKU id");
9358
9358
  return false;
9359
9359
  }
9360
- const skusMatchingUserCurrency = window.Pelcro.ecommerce.products.getSkus();
9361
- const itemMatchesUserCurrency = skusMatchingUserCurrency.some(sku => sku.id === quickPurchaseItem.id);
9362
- if (!itemMatchesUserCurrency) {
9363
- const userCurrency = window.Pelcro.user.read().currency;
9364
- console.error(`SKU currency (${quickPurchaseItem.currency}) doesn't match user account's currency (${userCurrency}). users can only purchase SKUs that match their account's currency`);
9365
- return false;
9366
- }
9360
+ window.Pelcro.ecommerce.products.getSkus();
9361
+
9362
+ // const itemMatchesUserCurrency = skusMatchingUserCurrency.some(
9363
+ // (sku) => sku.id === quickPurchaseItem.id
9364
+ // );
9365
+
9366
+ // if (!itemMatchesUserCurrency) {
9367
+ // const userCurrency = window.Pelcro.user.read().currency;
9368
+ // console.error(
9369
+ // `SKU currency (${quickPurchaseItem.currency}) doesn't match user account's currency (${userCurrency}). users can only purchase SKUs that match their account's currency`
9370
+ // );
9371
+ // return false;
9372
+ // }
9373
+
9367
9374
  const quickPurchaseItemWithQuantity = {
9368
9375
  ...quickPurchaseItem,
9369
9376
  quantity: 1
@@ -11698,21 +11705,24 @@ const init$1 = () => {
11698
11705
  if (!quickPurchaseItem) {
11699
11706
  return console.error("invalid item SKU id");
11700
11707
  }
11701
- const purchaseResult = purchaseItem(itemSkuId);
11702
- const itemDidntMatchUserCurrency = purchaseResult === false;
11703
- if (itemDidntMatchUserCurrency) {
11704
- var _window$Pelcro$user$r;
11705
- const userCurrency = (_window$Pelcro$user$r = window.Pelcro.user.read().currency) === null || _window$Pelcro$user$r === void 0 ? void 0 : _window$Pelcro$user$r.toUpperCase();
11706
- const errorMsg = i18next.t("shop:messages.currencyMismatch", {
11707
- currency: userCurrency
11708
- });
11709
- notify.error(errorMsg);
11710
- }
11708
+ purchaseItem(itemSkuId);
11709
+
11710
+ // if (itemDidntMatchUserCurrency) {
11711
+ // const userCurrency = window.Pelcro.user
11712
+ // .read()
11713
+ // .currency?.toUpperCase();
11714
+ // const errorMsg = i18n.t(
11715
+ // "shop:messages.currencyMismatch",
11716
+ // { currency: userCurrency }
11717
+ // );
11718
+ // notify.error(errorMsg);
11719
+ // }
11711
11720
  });
11712
11721
  }
11713
11722
  }
11714
11723
  });
11715
11724
  };
11725
+
11716
11726
  const authenticatedButtons = () => {
11717
11727
  saveToMetadataButton.authenticated();
11718
11728
  const pelcroLoginByClass = document.getElementsByClassName("pelcro-login-button");
@@ -28807,23 +28817,21 @@ const CartContainer = _ref => {
28807
28817
  }
28808
28818
  });
28809
28819
  } else {
28810
- const userCurrency = window.Pelcro.user.read().currency;
28811
- const itemsCurrency = cartItems[0].currency;
28812
- if (userCurrency && userCurrency !== itemsCurrency) {
28813
- dispatch({
28814
- type: DISABLE_SUBMIT,
28815
- payload: true
28816
- });
28817
- dispatch({
28818
- type: SHOW_ALERT,
28819
- payload: {
28820
- type: "error",
28821
- content: t("messages.currencyMismatch", {
28822
- currency: userCurrency.toUpperCase()
28823
- })
28824
- }
28825
- });
28826
- }
28820
+ window.Pelcro.user.read().currency;
28821
+ cartItems[0].currency;
28822
+
28823
+ // if (userCurrency && userCurrency !== itemsCurrency) {
28824
+ // dispatch({ type: DISABLE_SUBMIT, payload: true });
28825
+ // dispatch({
28826
+ // type: SHOW_ALERT,
28827
+ // payload: {
28828
+ // type: "error",
28829
+ // content: t("messages.currencyMismatch", {
28830
+ // currency: userCurrency.toUpperCase()
28831
+ // })
28832
+ // }
28833
+ // });
28834
+ // }
28827
28835
  }
28828
28836
  }, [cartItems]);
28829
28837
  const submit = (state, dispatch) => {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@pelcro/react-pelcro-js",
3
3
  "description": "Pelcro's React UI Elements",
4
- "version": "3.26.0-beta.73",
4
+ "version": "3.26.0-beta.75",
5
5
  "license": "MIT",
6
6
  "private": false,
7
7
  "main": "dist/index.cjs.js",