Skip to content

Commit

Permalink
adjust pagination flags when filtering
Browse files Browse the repository at this point in the history
  • Loading branch information
sheppard committed Aug 29, 2019
1 parent e94ebd6 commit c2b5ab0
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/app/src/app.js
Expand Up @@ -891,7 +891,7 @@ async function _displayList(ctx, parentInfo) {
filter.page = pnum;
}

if (!pnum && !model.opts.client) {
if (!pnum && (!model.opts.client || filter)) {
pnum = 1;
}

Expand Down Expand Up @@ -932,7 +932,7 @@ async function _displayList(ctx, parentInfo) {
let prevp = filter ? { ...filter } : {};
prevp.page = +pnum - 1;
prev = conf.url + '/?' + $.param(prevp);
} else if (pnum == 1) {
} else if (pnum == 1 && !filter) {
prev = conf.url + '/';
prevIsLocal = true;
}
Expand All @@ -952,7 +952,7 @@ async function _displayList(ctx, parentInfo) {
...parentInfo,
previous: prev ? '/' + prev : null,
next: next ? '/' + next : null,
multiple: model.opts.server && data.pages > model.opts.page,
multiple: prev || next ? true : false,
previous_is_local: prevIsLocal,
current_is_local: currentIsLocal
};
Expand Down

0 comments on commit c2b5ab0

Please sign in to comment.