mirror of
https://github.com/labring/FastGPT.git
synced 2025-07-30 10:28:42 +00:00
Perf: worfklow scroll cannot wheel. Adapt wrokflow skip circle. Change tab alway output stream (#2688)
* perf: teaxtarea no wheel * remove render error * adapt workflow skip circle * perf: change tab can stream output
This commit is contained in:
@@ -84,7 +84,7 @@ export const streamFetch = ({
|
||||
}
|
||||
|
||||
if (responseQueue.length > 0) {
|
||||
const fetchCount = Math.max(1, Math.round(responseQueue.length / 30));
|
||||
const fetchCount = Math.max(1, Math.round(responseQueue.length / 20));
|
||||
for (let i = 0; i < fetchCount; i++) {
|
||||
const item = responseQueue[i];
|
||||
onMessage(item);
|
||||
@@ -100,7 +100,9 @@ export const streamFetch = ({
|
||||
return finish();
|
||||
}
|
||||
|
||||
requestAnimationFrame(animateResponseText);
|
||||
window.windowHidden
|
||||
? setTimeout(animateResponseText, 16)
|
||||
: requestAnimationFrame(animateResponseText);
|
||||
}
|
||||
// start animation
|
||||
animateResponseText();
|
||||
|
@@ -13,3 +13,12 @@ export const getWebLLMModel = (model?: string) => {
|
||||
const list = useSystemStore.getState().llmModelList;
|
||||
return list.find((item) => item.model === model || item.name === model) ?? list[0];
|
||||
};
|
||||
|
||||
export const watchWindowHidden = () => {
|
||||
// @ts-ignore
|
||||
if (document.hidden) {
|
||||
window.windowHidden = true;
|
||||
} else {
|
||||
window.windowHidden = false;
|
||||
}
|
||||
};
|
||||
|
Reference in New Issue
Block a user