fix: always rAF-throttle markdown parsing during streaming

This commit is contained in:
Algorithm5838 2026-04-18 22:29:35 +03:00
parent a4d62253df
commit c2d675e6ac

View file

@ -71,17 +71,11 @@
};
const updateHandler = (content) => {
if (content) {
if (done) {
cancelAnimationFrame(pendingUpdate);
if (content && !pendingUpdate) {
pendingUpdate = requestAnimationFrame(() => {
pendingUpdate = null;
parseTokens();
} else if (!pendingUpdate) {
pendingUpdate = requestAnimationFrame(() => {
pendingUpdate = null;
parseTokens();
});
}
});
}
};