File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed
apps/frontend/src/pages/tasks.[id].samples.[id] Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -148,9 +148,15 @@ const AnnotationPage = () => {
148148 [ t ] ,
149149 ) ;
150150
151+ // 默认加载数量常量
152+ const PAGE_SIZE = 40 ;
151153 // 滚动加载
152154 const [ totalCount , setTotalCount ] = useState < number > ( 0 ) ;
153155 const currentPage = useRef < number > ( 1 ) ;
156+ if ( currentPage . current === 1 ) {
157+ currentPage . current = sample ?. data . inner_id ? Math . floor ( sample . data . inner_id / PAGE_SIZE ) + 1 : 1 ;
158+ }
159+
154160 const fetchSamples = useCallback ( async ( ) => {
155161 if ( ! routeParams . taskId ) {
156162 return Promise . resolve ( [ ] ) ;
@@ -159,7 +165,7 @@ const AnnotationPage = () => {
159165 const { data, meta_data } = await getSamples ( {
160166 task_id : + routeParams . taskId ! ,
161167 page : currentPage . current ,
162- size : 40 ,
168+ size : PAGE_SIZE ,
163169 } ) ;
164170
165171 currentPage . current += 1 ;
You can’t perform that action at this time.
0 commit comments