@umituz/react-native-ai-generation-content 1.19.1 → 1.19.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-ai-generation-content",
3
- "version": "1.19.1",
3
+ "version": "1.19.2",
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",
@@ -3,7 +3,7 @@
3
3
  * Couple future generation using centralized orchestrator
4
4
  */
5
5
 
6
- import { useMemo, useCallback } from "react";
6
+ import { useMemo, useCallback, useRef } from "react";
7
7
  import {
8
8
  useGenerationOrchestrator,
9
9
  type GenerationStrategy,
@@ -42,9 +42,15 @@ export const useCoupleFutureGeneration = <TResult>(
42
42
  [],
43
43
  );
44
44
 
45
+ // Store input for use in save callback
46
+ const lastInputRef = useRef<CoupleFutureInput | null>(null);
47
+
45
48
  const strategy: GenerationStrategy<CoupleFutureInput, TResult> = useMemo(
46
49
  () => ({
47
50
  execute: async (input, onProgress) => {
51
+ // Store input for save callback
52
+ lastInputRef.current = input;
53
+
48
54
  const result = await executeCoupleFuture(
49
55
  {
50
56
  partnerABase64: input.partnerABase64,
@@ -63,9 +69,12 @@ export const useCoupleFutureGeneration = <TResult>(
63
69
  getCreditCost: () => 1,
64
70
  save: buildCreation
65
71
  ? async (result, uid) => {
66
- const creation = buildCreation(result, {} as CoupleFutureInput);
67
- if (creation) {
68
- await repository.create(uid, creation);
72
+ const input = lastInputRef.current;
73
+ if (input) {
74
+ const creation = buildCreation(result, input);
75
+ if (creation) {
76
+ await repository.create(uid, creation);
77
+ }
69
78
  }
70
79
  }
71
80
  : undefined,