@umituz/react-native-ai-generation-content 1.83.34 → 1.83.36

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-ai-generation-content",
3
- "version": "1.83.34",
3
+ "version": "1.83.36",
4
4
  "description": "Provider-agnostic AI generation orchestration for React Native with result preview components",
5
5
  "main": "src/index.ts",
6
6
  "types": "src/index.ts",
@@ -65,6 +65,7 @@ export function useCreations({
65
65
  console.log("[useCreations] Setting up realtime listener", { userId });
66
66
  }
67
67
 
68
+ let isMounted = true;
68
69
  setIsLoading(true);
69
70
  setError(null);
70
71
 
@@ -72,19 +73,16 @@ export function useCreations({
72
73
 
73
74
  // Fallback timeout: if Firestore doesn't respond in 10s, stop loading
74
75
  const timeoutId = setTimeout(() => {
75
- setIsLoading((prev) => {
76
- if (prev) {
77
- if (typeof __DEV__ !== "undefined" && __DEV__) {
78
- console.warn("[useCreations] Loading timeout - setting empty state");
79
- }
80
- setData((currentData) => currentData ?? []);
81
- return false;
82
- }
83
- return prev;
84
- });
76
+ if (!isMounted) return;
77
+ if (typeof __DEV__ !== "undefined" && __DEV__) {
78
+ console.warn("[useCreations] Loading timeout - setting empty state");
79
+ }
80
+ setData((currentData) => currentData ?? []);
81
+ setIsLoading(false);
85
82
  }, 10000);
86
83
 
87
84
  return () => {
85
+ isMounted = false;
88
86
  clearTimeout(timeoutId);
89
87
  if (typeof __DEV__ !== "undefined" && __DEV__) {
90
88
  console.log("[useCreations] Cleaning up realtime listener");