Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
赵月辉
/
fastgpt-migrated
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Unverified
Commit
934776f4
authored
Aug 03, 2026
by
Xianquan
Committed by
GitHub
Aug 03, 2026
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(chat): stop single quote pagination loop (#7426)
parent
09896e77
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
4 deletions
+11
-4
packages/web/hooks/useLinkedScroll.tsx
+9
-3
projects/app/src/pageComponents/chat/ChatQuoteList/CollectionQuoteReader.tsx
+2
-1
No files found.
packages/web/hooks/useLinkedScroll.tsx
View file @
934776f4
...
@@ -8,6 +8,10 @@ import { useRequest } from './useRequest';
...
@@ -8,6 +8,10 @@ import { useRequest } from './useRequest';
const
threshold
=
200
;
const
threshold
=
200
;
/**
* 加载以锚点为中心的关联列表,并按滚动位置补充前后数据。
* 关闭分页时仍保留滚动容器和初始锚点请求,适用于只展示单条数据的场景。
*/
export
function
useLinkedScroll
<
export
function
useLinkedScroll
<
TParams
extends
LinkedPaginationProps
,
TParams
extends
LinkedPaginationProps
,
TData
extends
LinkedListResponse
TData
extends
LinkedListResponse
...
@@ -18,12 +22,14 @@ export function useLinkedScroll<
...
@@ -18,12 +22,14 @@ export function useLinkedScroll<
params
=
{},
params
=
{},
currentData
,
currentData
,
defaultScroll
=
'top'
,
defaultScroll
=
'top'
,
enablePagination
=
true
,
showErrorToast
=
true
showErrorToast
=
true
}:
{
}:
{
pageSize
?:
number
;
pageSize
?:
number
;
params
?:
Record
<
string
,
any
>
;
params
?:
Record
<
string
,
any
>
;
currentData
?:
{
id
:
string
;
anchor
?:
any
};
currentData
?:
{
id
:
string
;
anchor
?:
any
};
defaultScroll
?:
'top'
|
'bottom'
;
defaultScroll
?:
'top'
|
'bottom'
;
enablePagination
?:
boolean
;
showErrorToast
?:
boolean
;
showErrorToast
?:
boolean
;
}
}
)
{
)
{
...
@@ -246,7 +252,7 @@ export function useLinkedScroll<
...
@@ -246,7 +252,7 @@ export function useLinkedScroll<
useDebounceEffect
(
useDebounceEffect
(
()
=>
{
()
=>
{
if
(
!
actualContainerRef
?.
current
||
isLoading
)
return
;
if
(
!
enablePagination
||
!
actualContainerRef
?.
current
||
isLoading
)
return
;
const
{
scrollTop
,
scrollHeight
,
clientHeight
}
=
actualContainerRef
.
current
;
const
{
scrollTop
,
scrollHeight
,
clientHeight
}
=
actualContainerRef
.
current
;
...
@@ -260,7 +266,7 @@ export function useLinkedScroll<
...
@@ -260,7 +266,7 @@ export function useLinkedScroll<
loadPrevData
(
actualContainerRef
);
loadPrevData
(
actualContainerRef
);
}
}
},
},
[
scroll
],
[
scroll
,
enablePagination
],
{
wait
:
200
}
{
wait
:
200
}
);
);
...
@@ -280,7 +286,7 @@ export function useLinkedScroll<
...
@@ -280,7 +286,7 @@ export function useLinkedScroll<
</
MyBox
>
</
MyBox
>
);
);
},
},
[
isLoading
]
[
enablePagination
,
isLoading
]
);
);
return
{
return
{
...
...
projects/app/src/pageComponents/chat/ChatQuoteList/CollectionQuoteReader.tsx
View file @
934776f4
...
@@ -111,7 +111,8 @@ const CollectionReader = ({
...
@@ -111,7 +111,8 @@ const CollectionReader = ({
loadInitData
loadInitData
}
=
useLinkedScroll
(
getCollectionQuote
,
{
}
=
useLinkedScroll
(
getCollectionQuote
,
{
params
,
params
,
currentData
:
currentQuoteItem
currentData
:
currentQuoteItem
,
enablePagination
:
!
singleQuote
});
});
const
isDeleted
=
useMemo
(
const
isDeleted
=
useMemo
(
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment