From 862b7e6f02e1b9c8d8ac094e5fc4e2cf5a198527 Mon Sep 17 00:00:00 2001 From: Paul Grad Date: Sun, 31 Mar 2024 12:04:18 -0700 Subject: [PATCH] another api guard --- src/Story.tsx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/Story.tsx b/src/Story.tsx index 1efdf1a..e987dd9 100644 --- a/src/Story.tsx +++ b/src/Story.tsx @@ -32,6 +32,9 @@ function Story() { const [showTest, setShowTest] = useState(false); useEffect(() => { + if (storyHeading !== "") + return; + Api.getStoryText(`write me a story with a title in ${target} at a ${level} reading level and then make 4 questions in ${base} based on the story.`).then((data) => { const text = data.choices[0].text; if (!text)