@umituz/react-native-ai-generation-content 1.61.59 → 1.61.60

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.61.59",
3
+ "version": "1.61.60",
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",
@@ -58,6 +58,9 @@ export const useGenerationOrchestrator = <TInput, TResult>(
58
58
 
59
59
  const executeGeneration = useCallback(
60
60
  async (input: TInput) => {
61
+ const creditDeducted = await deductCredit(strategy.getCreditCost());
62
+ if (!creditDeducted) throw createGenerationError("credits", alertMessages.creditFailed);
63
+
61
64
  setState((prev) => ({ ...prev, status: "generating" }));
62
65
  if (typeof __DEV__ !== "undefined" && __DEV__) console.log("[Orchestrator] Starting generation");
63
66
 
@@ -72,9 +75,6 @@ export const useGenerationOrchestrator = <TInput, TResult>(
72
75
  }
73
76
  }
74
77
 
75
- const creditDeducted = await deductCredit(strategy.getCreditCost());
76
- if (!creditDeducted) throw createGenerationError("credits", alertMessages.creditFailed);
77
-
78
78
  if (isMountedRef.current) setState({ status: "success", isGenerating: false, result, error: null });
79
79
  if (typeof __DEV__ !== "undefined" && __DEV__) console.log("[Orchestrator] Generation SUCCESS");
80
80