diff --git a/src/lib/components/chat/Chat.svelte b/src/lib/components/chat/Chat.svelte index a44756febd..14a7de457f 100644 --- a/src/lib/components/chat/Chat.svelte +++ b/src/lib/components/chat/Chat.svelte @@ -964,7 +964,11 @@ }; $: if (history) { - getContents(); + cancelAnimationFrame(contentsRAF); + contentsRAF = requestAnimationFrame(() => { + getContents(); + contentsRAF = null; + }); } else { artifactContents.set([]); } @@ -1294,6 +1298,7 @@ }; let scrollRAF = null; + let contentsRAF = null; const scheduleScrollToBottom = () => { if (!scrollRAF) { scrollRAF = requestAnimationFrame(async () => {