@pelcro/react-pelcro-js 3.27.0 → 3.28.0
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 +26 -14
- package/dist/index.esm.js +26 -14
- package/package.json +1 -1
package/dist/index.cjs.js
CHANGED
|
@@ -11561,21 +11561,33 @@ const initPaywalls = () => {
|
|
|
11561
11561
|
return;
|
|
11562
11562
|
}
|
|
11563
11563
|
const {
|
|
11564
|
-
switchView
|
|
11564
|
+
switchView,
|
|
11565
|
+
isAuthenticated
|
|
11565
11566
|
} = usePelcro.getStore();
|
|
11566
|
-
|
|
11567
|
-
|
|
11568
|
-
|
|
11569
|
-
|
|
11570
|
-
|
|
11571
|
-
|
|
11572
|
-
|
|
11573
|
-
|
|
11574
|
-
|
|
11575
|
-
|
|
11576
|
-
|
|
11577
|
-
|
|
11578
|
-
|
|
11567
|
+
|
|
11568
|
+
// eslint-disable-next-line no-inner-declarations
|
|
11569
|
+
function displayPaywalls() {
|
|
11570
|
+
if (paywallMethods !== null && paywallMethods !== void 0 && paywallMethods.displayMeterPaywall()) {
|
|
11571
|
+
/*
|
|
11572
|
+
showing both the meter and the entitlements notification doesn't make sense from
|
|
11573
|
+
a product prespective + they would take half the screen on mobile devies, so we're
|
|
11574
|
+
not showing the meter, and only showing the entitlements notification.
|
|
11575
|
+
*/
|
|
11576
|
+
if (!didBlurContent) {
|
|
11577
|
+
switchView("meter");
|
|
11578
|
+
}
|
|
11579
|
+
} else if (paywallMethods !== null && paywallMethods !== void 0 && paywallMethods.displayNewsletterPaywall()) {
|
|
11580
|
+
switchView("newsletter");
|
|
11581
|
+
} else if (paywallMethods !== null && paywallMethods !== void 0 && paywallMethods.displayPaywall()) {
|
|
11582
|
+
switchView("plan-select");
|
|
11583
|
+
}
|
|
11584
|
+
}
|
|
11585
|
+
if ("id" in Pelcro.user.read() || !isAuthenticated()) {
|
|
11586
|
+
displayPaywalls();
|
|
11587
|
+
} else {
|
|
11588
|
+
addEventListener("PelcroUserLoaded", function () {
|
|
11589
|
+
displayPaywalls();
|
|
11590
|
+
}, true);
|
|
11579
11591
|
}
|
|
11580
11592
|
}
|
|
11581
11593
|
};
|
package/dist/index.esm.js
CHANGED
|
@@ -11531,21 +11531,33 @@ const initPaywalls = () => {
|
|
|
11531
11531
|
return;
|
|
11532
11532
|
}
|
|
11533
11533
|
const {
|
|
11534
|
-
switchView
|
|
11534
|
+
switchView,
|
|
11535
|
+
isAuthenticated
|
|
11535
11536
|
} = usePelcro.getStore();
|
|
11536
|
-
|
|
11537
|
-
|
|
11538
|
-
|
|
11539
|
-
|
|
11540
|
-
|
|
11541
|
-
|
|
11542
|
-
|
|
11543
|
-
|
|
11544
|
-
|
|
11545
|
-
|
|
11546
|
-
|
|
11547
|
-
|
|
11548
|
-
|
|
11537
|
+
|
|
11538
|
+
// eslint-disable-next-line no-inner-declarations
|
|
11539
|
+
function displayPaywalls() {
|
|
11540
|
+
if (paywallMethods !== null && paywallMethods !== void 0 && paywallMethods.displayMeterPaywall()) {
|
|
11541
|
+
/*
|
|
11542
|
+
showing both the meter and the entitlements notification doesn't make sense from
|
|
11543
|
+
a product prespective + they would take half the screen on mobile devies, so we're
|
|
11544
|
+
not showing the meter, and only showing the entitlements notification.
|
|
11545
|
+
*/
|
|
11546
|
+
if (!didBlurContent) {
|
|
11547
|
+
switchView("meter");
|
|
11548
|
+
}
|
|
11549
|
+
} else if (paywallMethods !== null && paywallMethods !== void 0 && paywallMethods.displayNewsletterPaywall()) {
|
|
11550
|
+
switchView("newsletter");
|
|
11551
|
+
} else if (paywallMethods !== null && paywallMethods !== void 0 && paywallMethods.displayPaywall()) {
|
|
11552
|
+
switchView("plan-select");
|
|
11553
|
+
}
|
|
11554
|
+
}
|
|
11555
|
+
if ("id" in Pelcro.user.read() || !isAuthenticated()) {
|
|
11556
|
+
displayPaywalls();
|
|
11557
|
+
} else {
|
|
11558
|
+
addEventListener("PelcroUserLoaded", function () {
|
|
11559
|
+
displayPaywalls();
|
|
11560
|
+
}, true);
|
|
11549
11561
|
}
|
|
11550
11562
|
}
|
|
11551
11563
|
};
|