@umituz/react-native-subscription 2.14.69 → 2.14.70

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.69",
3
+ "version": "2.14.70",
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",
@@ -77,6 +77,9 @@ export const useCredits = ({
77
77
  enabled: enabled && !!userId && isConfigured,
78
78
  staleTime,
79
79
  gcTime,
80
+ refetchOnMount: true, // Refetch when component mounts
81
+ refetchOnWindowFocus: true, // Refetch when app becomes active
82
+ refetchOnReconnect: true, // Refetch when network reconnects
80
83
  });
81
84
 
82
85
  const credits = data ?? null;
@@ -12,5 +12,7 @@ export const SUBSCRIPTION_QUERY_KEYS = {
12
12
  ["subscription", "initialized", userId] as const,
13
13
  } as const;
14
14
 
15
- export const STALE_TIME = 5 * 60 * 1000; // 5 minutes
16
- export const GC_TIME = 30 * 60 * 1000; // 30 minutes
15
+ // No cache - always fetch fresh data for subscription packages
16
+ // This ensures users always see real-time subscription status
17
+ export const STALE_TIME = 0; // Always stale - refetch immediately
18
+ export const GC_TIME = 0; // Don't cache - garbage collect immediately
@@ -38,5 +38,7 @@ export const useSubscriptionPackages = (userId: string | undefined) => {
38
38
  gcTime: GC_TIME,
39
39
  enabled: isConfigured,
40
40
  refetchOnMount: true,
41
+ refetchOnWindowFocus: true, // Refetch when app becomes active
42
+ refetchOnReconnect: true, // Refetch when network reconnects
41
43
  });
42
44
  };