Update GenerationScreen.tsx
This commit is contained in:
parent
15bbf19f2d
commit
e2a7d47a0b
1 changed files with 3 additions and 5 deletions
|
|
@ -7,7 +7,7 @@ import {
|
|||
import { InformationCircleIcon } from "@heroicons/react/24/outline";
|
||||
import { createRuleFilePath } from "core/config/markdown/utils";
|
||||
import { CreateRuleBlockArgs } from "core/tools/implementations/createRuleBlock";
|
||||
import { useContext, useEffect, useRef, useState } from "react";
|
||||
import { useContext, useEffect, useState } from "react";
|
||||
import { useForm } from "react-hook-form";
|
||||
import { IdeMessengerContext } from "../../context/IdeMessenger";
|
||||
import Spinner from "../gui/Spinner";
|
||||
|
|
@ -50,11 +50,9 @@ export function GenerationScreen({
|
|||
useRuleGeneration(inputPrompt);
|
||||
|
||||
// Start generation once when component mounts
|
||||
const hasInitialized = useRef(false);
|
||||
if (!hasInitialized.current) {
|
||||
hasInitialized.current = true;
|
||||
useEffect(() => {
|
||||
void generateRule();
|
||||
}
|
||||
}, []);
|
||||
|
||||
// Handle form updates when generation completes
|
||||
useEffect(() => {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue