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 @@ -145,9 +145,15 @@ const AnnotationPage = () => {
145145 [ t ] ,
146146 ) ;
147147
148+ // 默认加载数量常量
149+ const PAGE_SIZE = 40 ;
148150 // 滚动加载
149151 const [ totalCount , setTotalCount ] = useState < number > ( 0 ) ;
150152 const currentPage = useRef < number > ( 1 ) ;
153+ if ( currentPage . current === 1 ) {
154+ currentPage . current = sample ?. data . inner_id ? Math . floor ( sample . data . inner_id / PAGE_SIZE ) + 1 : 1 ;
155+ }
156+
151157 const fetchSamples = useCallback ( async ( ) => {
152158 if ( ! routeParams . taskId ) {
153159 return Promise . resolve ( [ ] ) ;
@@ -156,7 +162,7 @@ const AnnotationPage = () => {
156162 const { data, meta_data } = await getSamples ( {
157163 task_id : + routeParams . taskId ! ,
158164 page : currentPage . current ,
159- size : 40 ,
165+ size : PAGE_SIZE ,
160166 } ) ;
161167
162168 currentPage . current += 1 ;
You can’t perform that action at this time.
0 commit comments