소스 검색

Add wait for tick before scrolling down in openai

We had this wait on ollama but not for openai, causing it to fail
to scroll down in certain cases.

This fixes the issue.
Andrew Ryan 1 년 전
부모
커밋
d245b756a3
2개의 변경된 파일8개의 추가작업 그리고 0개의 파일을 삭제
  1. 4 0
      src/routes/(app)/+page.svelte
  2. 4 0
      src/routes/(app)/c/[id]/+page.svelte

+ 4 - 0
src/routes/(app)/+page.svelte

@@ -517,6 +517,10 @@
 
 	const sendPromptOpenAI = async (model, userPrompt, responseMessageId, _chatId) => {
 		const responseMessage = history.messages[responseMessageId];
+
+		// Wait until history/message have been updated
+		await tick();
+
 		scrollToBottom();
 
 		const docs = messages

+ 4 - 0
src/routes/(app)/c/[id]/+page.svelte

@@ -527,6 +527,10 @@
 
 	const sendPromptOpenAI = async (model, userPrompt, responseMessageId, _chatId) => {
 		const responseMessage = history.messages[responseMessageId];
+
+		// Wait until history/message have been updated
+		await tick();
+
 		scrollToBottom();
 
 		const docs = messages