Flip animation fix

This commit is contained in:
Dallas Hoffman 2023-10-17 23:34:09 -04:00
parent 7342c18c00
commit 73551c5596
No known key found for this signature in database
1 changed files with 5 additions and 2 deletions

View File

@ -11,13 +11,15 @@
const paddingRows = 2; const paddingRows = 2;
let scrollHeight = 0; let scrollHeight = 0;
let scrollOffset = 0; let scrollOffset = 0;
let flipDuration = 0;
let notesOffset = 0; let notesOffset = 0;
let notesLimit = 100; let notesLimit = 100;
let prevNotesCount = 0; let prevNotesCount = 0;
let prevRowHeight = 0; let prevRowHeight = 0;
let flipDuration = 0;
let flipTimeout: ReturnType<typeof setTimeout> | undefined;
const { noteScale } = settings; const { noteScale } = settings;
let scaleUnsubscribe: Unsubscriber; let scaleUnsubscribe: Unsubscriber;
let countUnsubscribe: Unsubscriber; let countUnsubscribe: Unsubscriber;
@ -41,7 +43,8 @@
if (notesCount !== prevNotesCount) { if (notesCount !== prevNotesCount) {
flipDuration = 300; flipDuration = 300;
setTimeout(() => { clearTimeout(flipTimeout);
flipTimeout = setTimeout(() => {
flipDuration = 0; flipDuration = 0;
}, 300); }, 300);
} }