浏览代码

Fix: InfiniteScroll sometimes can not fetch next page (#7550)

### What problem does this PR solve?

https://github.com/infiniflow/ragflow/issues/7538

### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)
tags/v0.19.0
Stephen Hu 5 个月前
父节点
当前提交
4a891f2d67
没有帐户链接到提交者的电子邮件
共有 1 个文件被更改,包括 32 次插入17 次删除
  1. 32
    17
      web/src/pages/flow/list/index.tsx

+ 32
- 17
web/src/pages/flow/list/index.tsx 查看文件

@@ -70,24 +70,39 @@ const FlowList = () => {
</Flex>

<Spin spinning={loading}>
<InfiniteScroll
dataLength={nextList?.length ?? 0}
next={fetchNextPage}
hasMore={hasNextPage}
loader={<Skeleton avatar paragraph={{ rows: 1 }} active />}
endMessage={!!total && <Divider plain>{t('noMoreData')} 🤐</Divider>}
scrollableTarget="scrollableDiv"
<div
id="scrollableDiv"
style={{
height: 'calc(100vh - 200px)',
overflow: 'auto',
}}
>
<Flex gap={'large'} wrap="wrap" className={styles.flowCardContainer}>
{nextList.length > 0 ? (
nextList.map((item) => {
return <FlowCard item={item} key={item.id}></FlowCard>;
})
) : (
<Empty className={styles.knowledgeEmpty}></Empty>
)}
</Flex>
</InfiniteScroll>
<InfiniteScroll
dataLength={nextList?.length ?? 0}
next={fetchNextPage}
hasMore={hasNextPage}
loader={<Skeleton avatar paragraph={{ rows: 1 }} active />}
endMessage={
!!total && <Divider plain>{t('noMoreData')} 🤐</Divider>
}
scrollableTarget="scrollableDiv"
scrollThreshold="200px"
>
<Flex
gap={'large'}
wrap="wrap"
className={styles.flowCardContainer}
>
{nextList.length > 0 ? (
nextList.map((item) => {
return <FlowCard item={item} key={item.id}></FlowCard>;
})
) : (
<Empty className={styles.knowledgeEmpty}></Empty>
)}
</Flex>
</InfiniteScroll>
</div>
</Spin>
{flowSettingVisible && (
<AgentTemplateModal

正在加载...
取消
保存