fix ai proxy logs pagination (#3954)

* fix ai proxy logs pagination

* delete unused code
This commit is contained in:
heheer
2025-03-05 14:08:38 +08:00
committed by GitHub
parent b2e2fa6b76
commit dbf25cef88
2 changed files with 8 additions and 3 deletions

View File

@@ -214,6 +214,11 @@ export function useScrollPagination<
async (init = false, ScrollContainerRef?: RefObject<HTMLDivElement>) => {
if (noMore && !init) return;
if (init) {
setData([]);
setTotal(0);
}
const offset = init ? 0 : data.length;
setTrue();
@@ -288,7 +293,7 @@ export function useScrollPagination<
// Watch scroll position
useThrottleEffect(
() => {
if (!ref?.current || noMore) return;
if (!ref?.current || noMore || isLoading || data.length === 0) return;
const { scrollTop, scrollHeight, clientHeight } = ref.current;
if (