Fix logic for setting and sending the initial chat message from the home page

- Load agents only once when the page loads, rather than triggering constant re-renders
This commit is contained in:
sabaimran
2024-08-01 13:53:16 +05:30
parent 9a43622cef
commit fd0e0405af
3 changed files with 28 additions and 27 deletions

View File

@@ -40,7 +40,8 @@ function ChatBodyData(props: ChatBodyDataProps) {
useEffect(() => {
const storedMessage = localStorage.getItem("message");
if (storedMessage) {
setMessage(storedMessage);
setProcessingMessage(true);
props.setQueryToProcess(storedMessage);
}
}, []);