Timothy Jaeryang Baek 3 months ago
parent
commit
b3001f95f6
1 changed files with 4 additions and 1 deletions
  1. 4 1
      src/lib/components/notes/NoteEditor/Chat.svelte

+ 4 - 1
src/lib/components/notes/NoteEditor/Chat.svelte

@@ -77,6 +77,9 @@
 			messages = messages;
 		}
 
+		await tick();
+		scrollToBottom();
+
 		const [res, controller] = await chatCompletion(
 			localStorage.token,
 			{
@@ -96,7 +99,7 @@
 		);
 
 		await tick();
-		const textareaElement = document.getElementById(`assistant-${messages.length - 1}-textarea`);
+		scrollToBottom();
 
 		if (res && res.ok) {
 			const reader = res.body