@umituz/react-native-subscription 2.27.86 → 2.27.88

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.27.86",
3
+ "version": "2.27.88",
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",
@@ -48,7 +48,15 @@ function deriveLoadStatus(
48
48
  export const useCredits = (): UseCreditsResult => {
49
49
  const userId = useAuthStore(selectUserId);
50
50
  const isConfigured = isCreditsRepositoryConfigured();
51
- const config = getCreditsConfig();
51
+
52
+ // Safe config access to prevent crash during initialization
53
+ let config;
54
+ try {
55
+ config = isConfigured ? getCreditsConfig() : { creditLimit: 200 }; // Default fallback
56
+ } catch (e) {
57
+ config = { creditLimit: 200 };
58
+ }
59
+
52
60
  const queryEnabled = !!userId && isConfigured;
53
61
 
54
62
  const { data, status, error, refetch } = useQuery({