@umituz/react-native-subscription 2.13.12 → 2.13.13

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.13.12",
3
+ "version": "2.13.13",
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",
@@ -7,6 +7,8 @@
7
7
 
8
8
  import { useQuery } from "@tanstack/react-query";
9
9
  import type { UserCredits, CreditType } from "../../domain/entities/Credits";
10
+
11
+ declare const __DEV__: boolean;
10
12
  import {
11
13
  getCreditsRepository,
12
14
  getCreditsConfig,
@@ -64,6 +66,18 @@ export const useCredits = ({
64
66
  const hasTextCredits = (credits?.textCredits ?? 0) > 0;
65
67
  const hasImageCredits = (credits?.imageCredits ?? 0) > 0;
66
68
 
69
+ if (__DEV__) {
70
+ console.log("[useCredits] State", {
71
+ userId,
72
+ enabled,
73
+ isLoading,
74
+ imageCredits: credits?.imageCredits ?? 0,
75
+ textCredits: credits?.textCredits ?? 0,
76
+ hasImageCredits,
77
+ hasTextCredits,
78
+ });
79
+ }
80
+
67
81
  const textCreditsPercent = credits
68
82
  ? Math.round((credits.textCredits / config.textCreditLimit) * 100)
69
83
  : 0;
@@ -84,6 +84,17 @@ export function useFeatureGate(
84
84
  ? credits?.imageCredits ?? 0
85
85
  : credits?.textCredits ?? 0;
86
86
 
87
+ if (__DEV__) {
88
+ console.log("[useFeatureGate] Hook state", {
89
+ userId,
90
+ isAuthenticated,
91
+ creditType,
92
+ hasCredits,
93
+ creditBalance,
94
+ isLoading,
95
+ });
96
+ }
97
+
87
98
  const requireFeature = useCallback(
88
99
  (action: () => void | Promise<void>) => {
89
100
  if (__DEV__) {