mirror of
https://github.com/labring/FastGPT.git
synced 2025-07-23 13:03:50 +00:00
fix ai proxy logs pagination (#3954)
* fix ai proxy logs pagination * delete unused code
This commit is contained in:
@@ -214,6 +214,11 @@ export function useScrollPagination<
|
|||||||
async (init = false, ScrollContainerRef?: RefObject<HTMLDivElement>) => {
|
async (init = false, ScrollContainerRef?: RefObject<HTMLDivElement>) => {
|
||||||
if (noMore && !init) return;
|
if (noMore && !init) return;
|
||||||
|
|
||||||
|
if (init) {
|
||||||
|
setData([]);
|
||||||
|
setTotal(0);
|
||||||
|
}
|
||||||
|
|
||||||
const offset = init ? 0 : data.length;
|
const offset = init ? 0 : data.length;
|
||||||
|
|
||||||
setTrue();
|
setTrue();
|
||||||
@@ -288,7 +293,7 @@ export function useScrollPagination<
|
|||||||
// Watch scroll position
|
// Watch scroll position
|
||||||
useThrottleEffect(
|
useThrottleEffect(
|
||||||
() => {
|
() => {
|
||||||
if (!ref?.current || noMore) return;
|
if (!ref?.current || noMore || isLoading || data.length === 0) return;
|
||||||
const { scrollTop, scrollHeight, clientHeight } = ref.current;
|
const { scrollTop, scrollHeight, clientHeight } = ref.current;
|
||||||
|
|
||||||
if (
|
if (
|
||||||
|
@@ -255,8 +255,8 @@ const ChannelLog = ({ Tab }: { Tab: React.ReactNode }) => {
|
|||||||
</Tr>
|
</Tr>
|
||||||
</Thead>
|
</Thead>
|
||||||
<Tbody>
|
<Tbody>
|
||||||
{formatData.map((item) => (
|
{formatData.map((item, index) => (
|
||||||
<Tr key={item.id}>
|
<Tr key={index}>
|
||||||
<Td>{item.channelName}</Td>
|
<Td>{item.channelName}</Td>
|
||||||
<Td>{item.model}</Td>
|
<Td>{item.model}</Td>
|
||||||
<Td>
|
<Td>
|
||||||
|
Reference in New Issue
Block a user