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>) => { 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 (

View File

@@ -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>