@pelcro/react-pelcro-js 3.0.0-beta.4 → 3.0.0-beta.5

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
@@ -9106,22 +9106,24 @@ const showInvoiceDetailsFromUrl = () => {
9106
9106
  const {
9107
9107
  isAuthenticated,
9108
9108
  setInvoice,
9109
+ whenSiteReady,
9109
9110
  switchView
9110
9111
  } = usePelcro.getStore();
9112
+ whenSiteReady(() => {
9113
+ if (!isAuthenticated()) {
9114
+ return switchView("login");
9115
+ }
9111
9116
 
9112
- if (!isAuthenticated()) {
9113
- return switchView("login");
9114
- }
9115
-
9116
- const invoiceId = window.Pelcro.helpers.getURLParameter("id");
9117
- const wasSetSuccessfully = setInvoice(invoiceId);
9117
+ const invoiceId = window.Pelcro.helpers.getURLParameter("id");
9118
+ const wasSetSuccessfully = setInvoice(invoiceId);
9118
9119
 
9119
- if (!wasSetSuccessfully) {
9120
- const translations = i18next.t("messages", {
9121
- returnObjects: true
9122
- });
9123
- notify.error(translations.invalidInvoice);
9124
- }
9120
+ if (!wasSetSuccessfully) {
9121
+ const translations = i18next.t("messages", {
9122
+ returnObjects: true
9123
+ });
9124
+ notify.error(translations.invalidInvoice);
9125
+ }
9126
+ });
9125
9127
  };
9126
9128
 
9127
9129
  const defaultOptions = {
package/dist/index.esm.js CHANGED
@@ -9076,22 +9076,24 @@ const showInvoiceDetailsFromUrl = () => {
9076
9076
  const {
9077
9077
  isAuthenticated,
9078
9078
  setInvoice,
9079
+ whenSiteReady,
9079
9080
  switchView
9080
9081
  } = usePelcro.getStore();
9082
+ whenSiteReady(() => {
9083
+ if (!isAuthenticated()) {
9084
+ return switchView("login");
9085
+ }
9081
9086
 
9082
- if (!isAuthenticated()) {
9083
- return switchView("login");
9084
- }
9085
-
9086
- const invoiceId = window.Pelcro.helpers.getURLParameter("id");
9087
- const wasSetSuccessfully = setInvoice(invoiceId);
9087
+ const invoiceId = window.Pelcro.helpers.getURLParameter("id");
9088
+ const wasSetSuccessfully = setInvoice(invoiceId);
9088
9089
 
9089
- if (!wasSetSuccessfully) {
9090
- const translations = i18next.t("messages", {
9091
- returnObjects: true
9092
- });
9093
- notify.error(translations.invalidInvoice);
9094
- }
9090
+ if (!wasSetSuccessfully) {
9091
+ const translations = i18next.t("messages", {
9092
+ returnObjects: true
9093
+ });
9094
+ notify.error(translations.invalidInvoice);
9095
+ }
9096
+ });
9095
9097
  };
9096
9098
 
9097
9099
  const defaultOptions = {
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.0.0-beta.4",
4
+ "version": "3.0.0-beta.5",
5
5
  "license": "MIT",
6
6
  "private": false,
7
7
  "main": "dist/index.cjs.js",