forked from XiaoMo/ChatGPT-Next-Web
feat: better animation speed
This commit is contained in:
parent
4f8a0b7711
commit
f2485931d9
@ -127,9 +127,11 @@ export class ChatGPTApi implements LLMApi {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (remainText.length > 0) {
|
if (remainText.length > 0) {
|
||||||
responseText += remainText[0];
|
const fetchCount = Math.max(1, Math.round(remainText.length / 60));
|
||||||
remainText = remainText.slice(1);
|
const fetchText = remainText.slice(0, fetchCount);
|
||||||
options.onUpdate?.(responseText, remainText[0]);
|
responseText += fetchText;
|
||||||
|
remainText = remainText.slice(fetchCount);
|
||||||
|
options.onUpdate?.(responseText, fetchText);
|
||||||
}
|
}
|
||||||
|
|
||||||
requestAnimationFrame(animateResponseText);
|
requestAnimationFrame(animateResponseText);
|
||||||
|
@ -24,8 +24,8 @@ export type { LocaleType, PartialLocaleType } from "./cn";
|
|||||||
const ALL_LANGS = {
|
const ALL_LANGS = {
|
||||||
cn,
|
cn,
|
||||||
en,
|
en,
|
||||||
pt,
|
|
||||||
tw,
|
tw,
|
||||||
|
pt,
|
||||||
jp,
|
jp,
|
||||||
ko,
|
ko,
|
||||||
id,
|
id,
|
||||||
|
@ -145,7 +145,7 @@ const pt: LocaleType = {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
Lang: {
|
Lang: {
|
||||||
Name: "Idioma",
|
Name: "Language",
|
||||||
All: "Todos os Idiomas",
|
All: "Todos os Idiomas",
|
||||||
},
|
},
|
||||||
Avatar: "Avatar",
|
Avatar: "Avatar",
|
||||||
|
Loading…
Reference in New Issue
Block a user