File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -108,20 +108,20 @@ export default function reducer(state = {}, action) {
108108 [ actions . SET_LIMIT ] : ( ) => {
109109 let maxPage = 1 ;
110110 if ( payload . limit > 0 ) {
111- maxPage = ( tableState . query . count / payload . limit ) || 1
111+ maxPage = Math . floor ( ( tableState . query . count / payload . limit ) ) || 1 ;
112112 }
113113 const currentPage = tableState . query . page > maxPage ? maxPage : tableState . query . page ;
114114 const offset = ( currentPage - 1 ) * payload . limit ;
115115
116116 let page = 1 ;
117117 if ( payload . limit > 0 ) {
118- page = ( offset / payload . limit ) + 1 ;
118+ page = Math . floor ( ( offset / payload . limit ) + 1 ) ;
119119 }
120120 return stateUpdater ( {
121121 isFetching : true ,
122122 query : {
123123 limit : parseInt ( payload . limit , 10 ) ,
124- page,
124+ page : page <= 1 ? 1 : page ,
125125 offset
126126 } ,
127127 } )
You can’t perform that action at this time.
0 commit comments