refactor: Enhance dependency tracking in List components for improved loading state management

This commit is contained in:
twwu 2025-09-16 13:37:49 +08:00
parent 1e9fce50a1
commit d790d2bc89
2 changed files with 2 additions and 2 deletions

View File

@ -44,7 +44,7 @@ const List = ({
observerRef.current.observe(anchorRef.current)
}
return () => observerRef.current?.disconnect()
}, [anchorRef, isLoading])
}, [anchorRef, isLoading, dataSourceStore])
const isAllLoading = isLoading && fileList.length === 0 && keywords.length === 0
const isPartialLoading = isLoading && fileList.length > 0

View File

@ -51,7 +51,7 @@ const Datasets = ({
observerRef.current.observe(anchorRef.current)
}
return () => observerRef.current?.disconnect()
}, [anchorRef])
}, [anchorRef, hasNextPage, isFetching, fetchNextPage])
return (
<>