Просмотр исходного кода

fix: add missing ref sync lines for auto-trigger in Steps 1 and 2

nonvioce 6 месяцев назад
Родитель
Сommit
977406ad9a

+ 2 - 0
src/app/features/novel-writer/components/pipeline/Step2EmbedHooks.tsx

@@ -129,6 +129,8 @@ ${chapterPlanSummary}
     }
   }, [apiSettings, chapterPlanSummary]);
 
+  generateHooksRef.current = generateHookOptions;
+
   const toggleHook = (id: string) => {
     setSelectedHookIds((prev) => {
       const next = new Set(prev);

+ 2 - 0
src/app/features/novel-writer/components/pipeline/Step4ContentEditor.tsx

@@ -656,6 +656,8 @@ ${antiText}
     }
   }, [apiSettings, projectPath, buildGenerationPrompt, ironRules, rollingSummaries]);
 
+  generateContentRef.current = generateContent;
+
   useEffect(() => {
     return () => {
       abortControllerRef.current?.abort();