From 2cd8b52fadc35e90e68457ed05f8b085d1f12370 Mon Sep 17 00:00:00 2001 From: Arik Chakma Date: Tue, 12 Nov 2024 23:49:26 +0600 Subject: [PATCH] fix: loading card --- src/components/CourseAI/CourseAIPopover.tsx | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/components/CourseAI/CourseAIPopover.tsx b/src/components/CourseAI/CourseAIPopover.tsx index 569b3dace..90c4f7fde 100644 --- a/src/components/CourseAI/CourseAIPopover.tsx +++ b/src/components/CourseAI/CourseAIPopover.tsx @@ -69,6 +69,7 @@ export function CourseAIPopover(props: CourseAIPopoverProps) { setMessage(''); }); + scrollToBottom(); completeCourseAIChat(newMessages); }; @@ -181,6 +182,10 @@ export function CourseAIPopover(props: CourseAIPopoverProps) { ); })} + {isLoading && !streamedMessage && ( + + )} + {streamedMessage && ( )} @@ -198,6 +203,7 @@ export function CourseAIPopover(props: CourseAIPopoverProps) { placeholder="Ask AI anything about the course..." value={message} onChange={(e) => setMessage(e.target.value)} + autoFocus={true} />