AxL95 commited on
Commit
47b750c
·
verified ·
1 Parent(s): 2ce88cd

Update frontend/src/components/ChatInterface.jsx

Browse files
frontend/src/components/ChatInterface.jsx CHANGED
@@ -21,6 +21,8 @@ saveBotResponse, toLogin }) => {
21
 
22
 
23
 
 
 
24
  const streamResponse = (response) => {
25
  setIsStreaming(true);
26
  setFullResponse(response);
@@ -31,7 +33,7 @@ saveBotResponse, toLogin }) => {
31
 
32
  const streamInterval = setInterval(() => {
33
  if (currentIndex < words.length) {
34
- setStreamingText(prev => prev + (prev ? ' ' : '') + words[currentIndex]);
35
  currentIndex++;
36
  } else {
37
  clearInterval(streamInterval);
@@ -44,6 +46,7 @@ saveBotResponse, toLogin }) => {
44
 
45
  return () => clearInterval(streamInterval);
46
  };
 
47
 
48
  const sendMessage = async (message) => {
49
  try {
 
21
 
22
 
23
 
24
+
25
+
26
  const streamResponse = (response) => {
27
  setIsStreaming(true);
28
  setFullResponse(response);
 
33
 
34
  const streamInterval = setInterval(() => {
35
  if (currentIndex < words.length) {
36
+ setStreamingText(prev => prev + (currentIndex > 0 ? ' ' : '') + words[currentIndex]);
37
  currentIndex++;
38
  } else {
39
  clearInterval(streamInterval);
 
46
 
47
  return () => clearInterval(streamInterval);
48
  };
49
+
50
 
51
  const sendMessage = async (message) => {
52
  try {