mirror of
https://github.com/Yidadaa/ChatGPT-Next-Web.git
synced 2025-08-09 12:31:58 +08:00
feat: better animation speed
This commit is contained in:
@@ -127,9 +127,11 @@ export class ChatGPTApi implements LLMApi {
|
||||
}
|
||||
|
||||
if (remainText.length > 0) {
|
||||
responseText += remainText[0];
|
||||
remainText = remainText.slice(1);
|
||||
options.onUpdate?.(responseText, remainText[0]);
|
||||
const fetchCount = Math.max(1, Math.round(remainText.length / 60));
|
||||
const fetchText = remainText.slice(0, fetchCount);
|
||||
responseText += fetchText;
|
||||
remainText = remainText.slice(fetchCount);
|
||||
options.onUpdate?.(responseText, fetchText);
|
||||
}
|
||||
|
||||
requestAnimationFrame(animateResponseText);
|
||||
|
Reference in New Issue
Block a user