File tree 1 file changed +3
-3
lines changed
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) {
108
108
[ actions . SET_LIMIT ] : ( ) => {
109
109
let maxPage = 1 ;
110
110
if ( payload . limit > 0 ) {
111
- maxPage = ( tableState . query . count / payload . limit ) || 1
111
+ maxPage = Math . floor ( ( tableState . query . count / payload . limit ) ) || 1 ;
112
112
}
113
113
const currentPage = tableState . query . page > maxPage ? maxPage : tableState . query . page ;
114
114
const offset = ( currentPage - 1 ) * payload . limit ;
115
115
116
116
let page = 1 ;
117
117
if ( payload . limit > 0 ) {
118
- page = ( offset / payload . limit ) + 1 ;
118
+ page = Math . floor ( ( offset / payload . limit ) + 1 ) ;
119
119
}
120
120
return stateUpdater ( {
121
121
isFetching : true ,
122
122
query : {
123
123
limit : parseInt ( payload . limit , 10 ) ,
124
- page,
124
+ page : page <= 1 ? 1 : page ,
125
125
offset
126
126
} ,
127
127
} )
You can’t perform that action at this time.
0 commit comments