@umituz/react-native-subscription 2.24.1 → 2.24.2

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.24.1",
3
+ "version": "2.24.2",
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",
@@ -5,8 +5,6 @@
5
5
  * Generic and reusable - uses config from module-level provider.
6
6
  */
7
7
 
8
- declare const __DEV__: boolean;
9
-
10
8
  import { useQuery } from "@umituz/react-native-design-system";
11
9
  import { useCallback, useMemo } from "react";
12
10
  import type { UserCredits } from "../../domain/entities/Credits";
@@ -65,37 +63,23 @@ export const useCredits = ({
65
63
 
66
64
  const queryEnabled = enabled && !!userId && isConfigured;
67
65
 
68
- if (__DEV__) {
69
- console.log("[useCredits] Query state:", {
70
- userId: userId?.slice(0, 8),
71
- enabled,
72
- isConfigured,
73
- queryEnabled,
74
- });
75
- }
76
-
77
66
  const { data, isLoading, error, refetch } = useQuery({
78
67
  queryKey: creditsQueryKeys.user(userId ?? ""),
79
68
  queryFn: async () => {
80
69
  if (!userId || !isConfigured) {
81
- if (__DEV__) console.log("[useCredits] Query skipped:", { hasUserId: !!userId, isConfigured });
82
70
  return null;
83
71
  }
84
- if (__DEV__) console.log("[useCredits] Executing queryFn for userId:", userId.slice(0, 8));
85
72
  const repository = getCreditsRepository();
86
73
  const result = await repository.getCredits(userId);
87
74
  if (!result.success) {
88
- if (__DEV__) console.error("[useCredits] Query failed:", result.error?.message);
89
75
  throw new Error(result.error?.message || "Failed to fetch credits");
90
76
  }
91
77
 
92
78
  // Background sync: If mapper detected expired status, sync to Firestore
93
79
  if (result.data?.status === "expired") {
94
- if (__DEV__) console.log("[useCredits] Detected expired subscription, syncing...");
95
80
  repository.syncExpiredStatus(userId).catch(() => {});
96
81
  }
97
82
 
98
- if (__DEV__) console.log("[useCredits] Query success:", { hasData: !!result.data, credits: result.data?.credits, status: result.data?.status });
99
83
  return result.data || null;
100
84
  },
101
85
  enabled: queryEnabled,
@@ -21,8 +21,6 @@
21
21
 
22
22
  import { useCallback } from "react";
23
23
 
24
- declare const __DEV__: boolean;
25
-
26
24
  export interface UseCreditsGateParams {
27
25
  /** Whether user has enough credits for the action */
28
26
  hasCredits: boolean;
@@ -52,27 +50,12 @@ export function useCreditsGate(
52
50
  const requireCredits = useCallback(
53
51
  (_action: () => void | Promise<void>): boolean => {
54
52
  if (!hasCredits) {
55
- if (__DEV__) {
56
-
57
- console.log("[useCreditsGate] Insufficient credits", {
58
- creditBalance,
59
- requiredCredits,
60
- });
61
- }
62
53
  onCreditsRequired(requiredCredits);
63
54
  return false;
64
55
  }
65
-
66
- if (__DEV__) {
67
-
68
- console.log("[useCreditsGate] Has credits, proceeding", {
69
- creditBalance,
70
- requiredCredits,
71
- });
72
- }
73
56
  return true;
74
57
  },
75
- [hasCredits, creditBalance, requiredCredits, onCreditsRequired]
58
+ [hasCredits, requiredCredits, onCreditsRequired]
76
59
  );
77
60
 
78
61
  return {