From a84a7b269e66be59811f9e53b51839047deee308 Mon Sep 17 00:00:00 2001 From: Webifi Date: Fri, 16 Jun 2023 10:42:23 -0500 Subject: [PATCH] Scroll to bottom after messages render --- src/lib/Chat.svelte | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/lib/Chat.svelte b/src/lib/Chat.svelte index 89c975c..418c53e 100644 --- a/src/lib/Chat.svelte +++ b/src/lib/Chat.svelte @@ -33,9 +33,7 @@ faMicrophone, faLightbulb, faCommentSlash, - faCircleCheck - } from '@fortawesome/free-solid-svg-icons/index' import { v4 as uuidv4 } from 'uuid' import { getPrice } from './Stats.svelte' @@ -50,11 +48,6 @@ const chatId: number = parseInt(params.chatId) let chatRequest = new ChatRequest() - - // let controller:AbortController - - // let updating: boolean|number = false - // let updatingMessage: string = '' let input: HTMLTextAreaElement let recognition: any = null let recording = false @@ -98,6 +91,12 @@ $: onStateChange($checkStateChange, $showSetChatSettings, $submitExitingPromptsNow, $continueMessage) + const afterChatLoad = (...args:any) => { + scrollToBottom() + } + + $: afterChatLoad($currentChatId) + setCurrentChat(0) // Make sure chat object is ready to go updateChatSettings(chatId)