@umituz/react-native-subscription 2.14.34 → 2.14.35

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.14.34",
3
+ "version": "2.14.35",
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",
@@ -98,6 +98,10 @@ class SubscriptionManagerImpl {
98
98
  return promise;
99
99
  }
100
100
 
101
+ isConfigured(): boolean {
102
+ return this.managerConfig !== null && this.packageHandler !== null;
103
+ }
104
+
101
105
  isInitialized(): boolean {
102
106
  return this.serviceInstance?.isInitialized() ?? false;
103
107
  }
@@ -17,8 +17,13 @@ import {
17
17
  * Works for both authenticated and anonymous users
18
18
  */
19
19
  export const useSubscriptionPackages = (userId: string | undefined) => {
20
+ const isConfigured = SubscriptionManager.isConfigured();
21
+
20
22
  if (__DEV__) {
21
- console.log('[DEBUG useSubscriptionPackages] Hook called', { userId: userId || 'ANONYMOUS' });
23
+ console.log('[DEBUG useSubscriptionPackages] Hook called', {
24
+ userId: userId || 'ANONYMOUS',
25
+ isConfigured,
26
+ });
22
27
  }
23
28
 
24
29
  return useQuery({
@@ -89,7 +94,7 @@ export const useSubscriptionPackages = (userId: string | undefined) => {
89
94
  },
90
95
  staleTime: STALE_TIME,
91
96
  gcTime: GC_TIME,
92
- enabled: true, // Always enabled - works for both authenticated and anonymous users
97
+ enabled: isConfigured, // Only enabled when SubscriptionManager is configured
93
98
  refetchOnMount: "always", // Always refetch to get fresh packages (fixes cached empty results)
94
99
  });
95
100
  };