Skip to content

Commit 229da72

Browse files
committed
fix: cancel pending rAFs on Chat destroy
1 parent 2785e86 commit 229da72

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

src/lib/components/chat/Chat.svelte

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -821,6 +821,10 @@
821821
822822
return () => {
823823
try {
824+
cancelAnimationFrame(scrollRAF);
825+
cancelAnimationFrame(contentsRAF);
826+
scrollRAF = null;
827+
contentsRAF = null;
824828
if (chatIdProp && !$temporaryChatEnabled) {
825829
updateLastReadAt(chatIdProp);
826830
}

0 commit comments

Comments
 (0)