From 73551c55969249672d5004208df44be6c9bc1a35 Mon Sep 17 00:00:00 2001 From: Dallas Hoffman Date: Tue, 17 Oct 2023 23:34:09 -0400 Subject: [PATCH] Flip animation fix --- src/lib/components/notes/note-list.svelte | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/lib/components/notes/note-list.svelte b/src/lib/components/notes/note-list.svelte index e5458f3..6f2e95a 100644 --- a/src/lib/components/notes/note-list.svelte +++ b/src/lib/components/notes/note-list.svelte @@ -11,13 +11,15 @@ const paddingRows = 2; let scrollHeight = 0; let scrollOffset = 0; - let flipDuration = 0; let notesOffset = 0; let notesLimit = 100; let prevNotesCount = 0; let prevRowHeight = 0; + let flipDuration = 0; + let flipTimeout: ReturnType | undefined; + const { noteScale } = settings; let scaleUnsubscribe: Unsubscriber; let countUnsubscribe: Unsubscriber; @@ -41,7 +43,8 @@ if (notesCount !== prevNotesCount) { flipDuration = 300; - setTimeout(() => { + clearTimeout(flipTimeout); + flipTimeout = setTimeout(() => { flipDuration = 0; }, 300); }