@umituz/react-native-subscription 2.37.17 → 2.37.18
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@umituz/react-native-subscription",
|
|
3
|
-
"version": "2.37.
|
|
3
|
+
"version": "2.37.18",
|
|
4
4
|
"description": "Complete subscription management with RevenueCat, paywall UI, and credits system for React Native apps",
|
|
5
5
|
"main": "./src/index.ts",
|
|
6
6
|
"types": "./src/index.ts",
|
|
@@ -54,6 +54,13 @@ export const PaywallContainer: React.FC<PaywallContainerProps> = (props) => {
|
|
|
54
54
|
return createCreditAmountsFromPackages(packages, packageAllocations);
|
|
55
55
|
}, [providedCreditAmounts, packageAllocations, packages]);
|
|
56
56
|
|
|
57
|
+
// When using credit system, only show packages that have a credit allocation.
|
|
58
|
+
// This filters out lifetime/"unlimited" plans that aren't part of the credit model.
|
|
59
|
+
const displayPackages = useMemo(() => {
|
|
60
|
+
if (!creditAmounts || Object.keys(creditAmounts).length === 0) return packages;
|
|
61
|
+
return packages.filter((pkg) => creditAmounts[pkg.product.identifier] != null);
|
|
62
|
+
}, [packages, creditAmounts]);
|
|
63
|
+
|
|
57
64
|
if (!isVisible) return null;
|
|
58
65
|
|
|
59
66
|
return (
|
|
@@ -61,7 +68,7 @@ export const PaywallContainer: React.FC<PaywallContainerProps> = (props) => {
|
|
|
61
68
|
visible={isVisible}
|
|
62
69
|
onClose={handleClose}
|
|
63
70
|
translations={translations}
|
|
64
|
-
packages={
|
|
71
|
+
packages={displayPackages}
|
|
65
72
|
legalUrls={legalUrls}
|
|
66
73
|
features={features ? [...features] : undefined}
|
|
67
74
|
heroImage={heroImage}
|