fix loadInitData refresh (#4169)
* fix * fix * form input number default & api dataset max token
This commit is contained in:
@@ -34,13 +34,13 @@ export function useLinkedScroll<
|
||||
bottom: null as { _id: string; index: number } | null
|
||||
});
|
||||
const containerRef = useRef<HTMLDivElement>(null);
|
||||
const itemRefs = useRef<(HTMLElement | null)[]>([]);
|
||||
const itemRefs = useRef<Map<string, HTMLElement | null>>(new Map());
|
||||
|
||||
const scrollToItem = async (id: string, retry = 3) => {
|
||||
const itemIndex = dataList.findIndex((item) => item._id === id);
|
||||
if (itemIndex === -1) return;
|
||||
|
||||
const element = itemRefs.current[itemIndex];
|
||||
const element = itemRefs.current.get(id);
|
||||
|
||||
if (!element || !containerRef.current) {
|
||||
if (retry > 0) {
|
||||
@@ -64,7 +64,8 @@ export function useLinkedScroll<
|
||||
|
||||
let scroolSign = useRef(false);
|
||||
const { runAsync: loadInitData } = useRequest2(
|
||||
async (scrollWhenFinish = true, refresh = false) => {
|
||||
async ({ scrollWhenFinish, refresh } = { scrollWhenFinish: true, refresh: false }) => {
|
||||
console.log('loadInitData', params);
|
||||
if (!currentData || isLoading) return;
|
||||
|
||||
const item = dataList.find((item) => item._id === currentData.id);
|
||||
|
||||
Reference in New Issue
Block a user