Skip to content

Commit

Permalink
Listen for updated conversations in TextOutput
Browse files Browse the repository at this point in the history
  • Loading branch information
albin-karlsson committed Apr 18, 2024
1 parent 39ce335 commit dc23729
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions client/src/components/TextOutput.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ function TextOutput({ conversation }) {
fontFamily: "Arial, sans-serif",
};

useEffect(() => {
console.log("Updated conversation:", conversation);
}, [conversation]); // Make sure to use [conversation] to track changes properly

// Check if the conversation has at least one message and display it, otherwise show a default message.
// const firstMessageText =
// conversation.length > 0 ? conversation[0].text : "No messages yet.";
Expand Down

0 comments on commit dc23729

Please sign in to comment.