fix: always rAF-throttle markdown parsing during streaming (#23868)
This commit is contained in:
1 parent
4790faba73
commit
81383a7df1
1 file changed
+3
-9
@@ -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();
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in new issue
Block a user