diff --git a/src/lib/components/chat/Chat.svelte b/src/lib/components/chat/Chat.svelte index 8b3fecc55..79284751e 100644 --- a/src/lib/components/chat/Chat.svelte +++ b/src/lib/components/chat/Chat.svelte @@ -936,11 +936,11 @@ const onHistoryChange = (history) => { if (history) { - cancelAnimationFrame(contentsRAF); - contentsRAF = requestAnimationFrame(() => { + clearTimeout(contentsRAF); + contentsRAF = setTimeout(() => { getContents(); contentsRAF = null; - }); + }, 0); } else { artifactContents.set([]); }