Fixed pagination not updating with async requests.
This commit is contained in:
@@ -169,8 +169,12 @@ function go(page, event) {
|
||||
}
|
||||
|
||||
function getPath(page) {
|
||||
if (!routeParams.path && props.includeQuery) {
|
||||
return `${pageContext.urlParsed.pathname}${page}${urlParsed.searchOriginal}`;
|
||||
const query = typeof window === 'undefined'
|
||||
? urlParsed.searchOriginal
|
||||
: window.location.search;
|
||||
|
||||
if (!routeParams.path && props.includeQuery && query) {
|
||||
return `${pageContext.urlParsed.pathname}${page}${query}`;
|
||||
}
|
||||
|
||||
if (!routeParams.path) {
|
||||
@@ -187,8 +191,8 @@ function getPath(page) {
|
||||
})
|
||||
.join('');
|
||||
|
||||
if (props.includeQuery && urlParsed.searchOriginal) {
|
||||
return `${path}${urlParsed.searchOriginal}`;
|
||||
if (props.includeQuery && query) {
|
||||
return `${path}${query}`;
|
||||
}
|
||||
|
||||
return path;
|
||||
|
||||
Reference in New Issue
Block a user