Skip to content

Commit

Permalink
another api guard
Browse files Browse the repository at this point in the history
  • Loading branch information
PGrad committed Mar 31, 2024
1 parent 5823616 commit 862b7e6
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/Story.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ function Story() {
const [showTest, setShowTest] = useState<boolean>(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)
Expand Down

0 comments on commit 862b7e6

Please sign in to comment.