@umituz/react-native-subscription 2.26.2 → 2.26.4

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.26.2",
3
+ "version": "2.26.4",
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",
@@ -81,7 +81,7 @@ export function useFeatureGate(
81
81
 
82
82
  // Execute pending action when credits increase after purchase
83
83
  useEffect(() => {
84
- const prevBalance = prevCreditBalanceRef.current;
84
+ const prevBalance = prevCreditBalanceRef.current ?? 0; // ← FIX: Default to 0 if undefined
85
85
  const currentBalance = creditBalance;
86
86
  const creditsIncreased = currentBalance > prevBalance;
87
87
 
@@ -91,7 +91,11 @@ export function useFeatureGate(
91
91
  isWaitingForPurchaseRef.current = false;
92
92
 
93
93
  if (typeof __DEV__ !== "undefined" && __DEV__) {
94
- console.log("[useFeatureGate] Credits increased, executing pending action");
94
+ console.log("[useFeatureGate] Credits increased, executing pending action", {
95
+ prevBalance,
96
+ currentBalance,
97
+ creditsIncreased,
98
+ });
95
99
  }
96
100
  action();
97
101
  }