Skip to content

Commit 7d704d4

Browse files
committed
fix: cancel pending rAFs on Chat destroy
1 parent b0d89d1 commit 7d704d4

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
@@ -845,6 +845,10 @@
845845
846846
return () => {
847847
try {
848+
cancelAnimationFrame(scrollRAF);
849+
cancelAnimationFrame(contentsRAF);
850+
scrollRAF = null;
851+
contentsRAF = null;
848852
if (controlsSaveTimer !== null) {
849853
clearTimeout(controlsSaveTimer);
850854
controlsSaveTimer = null;

0 commit comments

Comments
 (0)