File tree Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -76,7 +76,7 @@ export namespace PostListView {
7676
7777 const fut = async ( ) => {
7878 await setRefreshing ( true )
79- const page = await postDataProvider . loadPost ( )
79+ const page = await postDataProvider . loadPosts ( )
8080 const postCount = await PostService . getCount ( )
8181 const pageCount = calcPageCount ( page . cap , postCount )
8282 const pageIndex = page . index
Original file line number Diff line number Diff line change @@ -53,15 +53,15 @@ export class PostDataProvider implements TreeDataProvider<PostListTreeItem> {
5353 return toTreeItem ( item )
5454 }
5555
56- async loadPost ( ) {
57- const pageIndex = getListState ( ) . pageIndex
58- const pageCap = PostListCfg . getListPageSize ( )
56+ async loadPosts ( ) : Promise < Page < Post > > {
57+ const { pageIndex } = getListState ( ) ?? { }
58+ const pageSize = PostListCfg . getListPageSize ( )
5959
6060 try {
61- const result = await PostService . getList ( pageIndex , pageCap )
61+ const result = await PostService . getList ( pageIndex , pageSize )
6262 this . page = {
6363 index : pageIndex ,
64- cap : pageCap ,
64+ cap : pageSize ,
6565 // TODO: need better design
6666 items : result . map ( it => Object . assign ( new Post ( ) , it ) ) ,
6767 }
You can’t perform that action at this time.
0 commit comments