@umituz/react-native-subscription 2.24.8 → 2.24.9

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.8",
3
+ "version": "2.24.9",
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",
@@ -72,7 +72,7 @@ export const PaywallFeedbackModal: React.FC<PaywallFeedbackModalProps> = React.m
72
72
  <Modal
73
73
  visible={visible}
74
74
  transparent
75
- animationType="fade"
75
+ animationType="none"
76
76
  onRequestClose={handleSkip}
77
77
  >
78
78
  <Pressable onPress={handleSkip} style={styles.overlay}>
@@ -22,7 +22,7 @@ export const PurchaseLoadingOverlay: React.FC<PurchaseLoadingOverlayProps> = Rea
22
22
  if (!isPurchasing) return null;
23
23
 
24
24
  return (
25
- <Modal visible transparent animationType="fade" statusBarTranslucent>
25
+ <Modal visible transparent animationType="none" statusBarTranslucent>
26
26
  <View style={[styles.container, { backgroundColor: "rgba(0, 0, 0, 0.7)" }]}>
27
27
  <View style={[styles.content, { backgroundColor: tokens.colors.surface }]}>
28
28
  <AtomicSpinner size="lg" color="primary" />
@@ -4,7 +4,6 @@
4
4
  */
5
5
 
6
6
  import { useCallback, useRef, useEffect } from "react";
7
- import { InteractionManager } from "react-native";
8
7
  import { useAuthGate } from "./useAuthGate";
9
8
  import { useSubscriptionGate } from "./useSubscriptionGate";
10
9
  import { useCreditsGate } from "./useCreditsGate";
@@ -81,7 +80,6 @@ export function useFeatureGate(
81
80
  }, [onShowPaywall]);
82
81
 
83
82
  // Execute pending action when credits increase after purchase
84
- // Delay execution to allow paywall modal to fully close and prevent RN Modal conflicts
85
83
  useEffect(() => {
86
84
  const prevBalance = prevCreditBalanceRef.current;
87
85
  const currentBalance = creditBalance;
@@ -93,19 +91,9 @@ export function useFeatureGate(
93
91
  isWaitingForPurchaseRef.current = false;
94
92
 
95
93
  if (typeof __DEV__ !== "undefined" && __DEV__) {
96
- console.log("[useFeatureGate] Credits increased, executing pending action with delay");
94
+ console.log("[useFeatureGate] Credits increased, executing pending action");
97
95
  }
98
-
99
- // Wait for paywall modal to fully close before executing pending action
100
- // This prevents React Native Modal conflicts
101
- InteractionManager.runAfterInteractions(() => {
102
- setTimeout(() => {
103
- if (typeof __DEV__ !== "undefined" && __DEV__) {
104
- console.log("[useFeatureGate] Executing pending action now");
105
- }
106
- action();
107
- }, 300);
108
- });
96
+ action();
109
97
  }
110
98
 
111
99
  prevCreditBalanceRef.current = creditBalance;
@@ -137,19 +125,16 @@ export function useFeatureGate(
137
125
  // Wrap action to re-check credits after auth succeeds
138
126
  // Using refs to get current values when callback executes
139
127
  const postAuthAction = () => {
140
- // Step 2: Subscription check (bypasses credits if subscribed)
128
+ // Subscription check (bypasses credits if subscribed)
141
129
  if (hasSubscriptionRef.current) {
142
130
  if (typeof __DEV__ !== "undefined" && __DEV__) {
143
- console.log("[useFeatureGate] User has subscription, executing with delay");
131
+ console.log("[useFeatureGate] User has subscription, executing action");
144
132
  }
145
- // Wait for auth modal to fully close
146
- InteractionManager.runAfterInteractions(() => {
147
- setTimeout(() => action(), 300);
148
- });
133
+ action();
149
134
  return;
150
135
  }
151
136
 
152
- // Step 3: Credits check (use ref for current value)
137
+ // Credits check
153
138
  if (!hasCreditsRef.current) {
154
139
  pendingActionRef.current = action;
155
140
  isWaitingForPurchaseRef.current = true;
@@ -157,13 +142,11 @@ export function useFeatureGate(
157
142
  return;
158
143
  }
159
144
 
160
- // All checks passed - wait for auth modal to fully close
145
+ // All checks passed
161
146
  if (typeof __DEV__ !== "undefined" && __DEV__) {
162
- console.log("[useFeatureGate] User has credits, executing with delay");
147
+ console.log("[useFeatureGate] User has credits, executing action");
163
148
  }
164
- InteractionManager.runAfterInteractions(() => {
165
- setTimeout(() => action(), 300);
166
- });
149
+ action();
167
150
  };
168
151
  onShowAuthModal(postAuthAction);
169
152
  return;