@umituz/react-native-ai-generation-content 1.56.2 → 1.56.3

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.56.2",
3
+ "version": "1.56.3",
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",
@@ -40,6 +40,7 @@ export const useWizardGeneration = (
40
40
  } = props;
41
41
 
42
42
  const hasStarted = useRef(false);
43
+ const hasError = useRef(false);
43
44
 
44
45
  const persistence = useMemo(() => createCreationPersistence(), []);
45
46
  const strategy = useMemo(
@@ -75,13 +76,14 @@ export const useWizardGeneration = (
75
76
  useEffect(() => {
76
77
  const isAlreadyGenerating = videoGeneration.isGenerating || photoGeneration.isGenerating;
77
78
 
78
- if (isGeneratingStep && !hasStarted.current && !isAlreadyGenerating) {
79
+ if (isGeneratingStep && !hasStarted.current && !isAlreadyGenerating && !hasError.current) {
79
80
  hasStarted.current = true;
80
81
 
81
82
  buildWizardInput(wizardData, scenario)
82
83
  .then(async (input) => {
83
84
  if (!input) {
84
85
  hasStarted.current = false;
86
+ hasError.current = true;
85
87
  onError?.("Failed to build generation input");
86
88
  return;
87
89
  }
@@ -103,12 +105,14 @@ export const useWizardGeneration = (
103
105
  console.error("[WizardGeneration] Build input error:", error.message);
104
106
  }
105
107
  hasStarted.current = false;
108
+ hasError.current = true;
106
109
  onError?.(error.message);
107
110
  });
108
111
  }
109
112
 
110
- if (!isGeneratingStep && hasStarted.current) {
113
+ if (!isGeneratingStep) {
111
114
  hasStarted.current = false;
115
+ hasError.current = false;
112
116
  }
113
117
  }, [
114
118
  isGeneratingStep,