|
|
@@ -656,8 +656,6 @@ ${antiText}
|
|
|
}
|
|
|
}, [apiSettings, projectPath, buildGenerationPrompt, ironRules, rollingSummaries]);
|
|
|
|
|
|
- generateContentRef.current = generateContent;
|
|
|
-
|
|
|
useEffect(() => {
|
|
|
return () => {
|
|
|
abortControllerRef.current?.abort();
|
|
|
@@ -679,11 +677,13 @@ ${antiText}
|
|
|
const autoContentStartedRef = useRef(false);
|
|
|
const autoDeAIStartedRef = useRef(false);
|
|
|
const generateContentRef = useRef<() => Promise<void>>(async () => {});
|
|
|
+
|
|
|
+ generateContentRef.current = generateContent;
|
|
|
+
|
|
|
useEffect(() => {
|
|
|
if (autoMode && apiSettings && !autoContentStartedRef.current && !isGenerating) {
|
|
|
autoContentStartedRef.current = true;
|
|
|
- // Small delay to ensure all state is initialized
|
|
|
- const timer = setTimeout(() => generateContent(), 200);
|
|
|
+ const timer = setTimeout(() => generateContentRef.current(), 300);
|
|
|
return () => clearTimeout(timer);
|
|
|
}
|
|
|
}, [autoMode, apiSettings, isGenerating]);
|