Skip to content

Commit e2a7d47

Browse files
Update GenerationScreen.tsx
1 parent 15bbf19 commit e2a7d47

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

gui/src/components/GenerateRuleDialog/GenerationScreen.tsx

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import {
77
import { InformationCircleIcon } from "@heroicons/react/24/outline";
88
import { createRuleFilePath } from "core/config/markdown/utils";
99
import { CreateRuleBlockArgs } from "core/tools/implementations/createRuleBlock";
10-
import { useContext, useEffect, useRef, useState } from "react";
10+
import { useContext, useEffect, useState } from "react";
1111
import { useForm } from "react-hook-form";
1212
import { IdeMessengerContext } from "../../context/IdeMessenger";
1313
import Spinner from "../gui/Spinner";
@@ -50,11 +50,9 @@ export function GenerationScreen({
5050
useRuleGeneration(inputPrompt);
5151

5252
// Start generation once when component mounts
53-
const hasInitialized = useRef(false);
54-
if (!hasInitialized.current) {
55-
hasInitialized.current = true;
53+
useEffect(() => {
5654
void generateRule();
57-
}
55+
}, []);
5856

5957
// Handle form updates when generation completes
6058
useEffect(() => {

0 commit comments

Comments
 (0)