This commit is contained in:
Timothy Jaeryang Baek committed 2026-05-09 06:44:42 +09:00
1 parent bb0e6cb108
commit 29f6c72e87
1 file changed
+7 -1
@@ -71,12 +71,18 @@
}; };
const updateHandler = (content) => { const updateHandler = (content) => {
if (content && !pendingUpdate) { if (content) {
if (done) {
cancelAnimationFrame(pendingUpdate);
pendingUpdate = null;
parseTokens();
} else if (!pendingUpdate) {
pendingUpdate = requestAnimationFrame(() => { pendingUpdate = requestAnimationFrame(() => {
pendingUpdate = null; pendingUpdate = null;
parseTokens(); parseTokens();
}); });
} }
}
}; };
$: updateHandler(content); $: updateHandler(content);