fix: always rAF-throttle markdown parsing during streaming (#23868)

This commit is contained in:
Algorithm5838
2026-04-21 13:29:33 +09:00
committed by GitHub
parent 4790faba73
commit 81383a7df1
@@ -71,18 +71,12 @@
}; };
const updateHandler = (content) => { const updateHandler = (content) => {
if (content) { if (content && !pendingUpdate) {
if (done) {
cancelAnimationFrame(pendingUpdate);
pendingUpdate = null;
parseTokens();
} else if (!pendingUpdate) {
pendingUpdate = requestAnimationFrame(() => { pendingUpdate = requestAnimationFrame(() => {
pendingUpdate = null; pendingUpdate = null;
parseTokens(); parseTokens();
}); });
} }
}
}; };
$: updateHandler(content); $: updateHandler(content);