set page/perPage URL args together

Since there's no UI to set the page size, this makes the argument more discoverable.
This commit is contained in:
Jesse Plamondon-Willard 2022-04-21 20:59:35 -04:00
parent c055056460
commit 4fa414c2bd
No known key found for this signature in database
GPG Key ID: CF8B1456B3E29F49
1 changed files with 6 additions and 3 deletions

View File

@ -743,11 +743,14 @@ smapi.logParser = function (state) {
updateUrl: function () {
const url = new URL(location);
if (state.page != 1)
if (state.page != 1 || state.perPage != defaultPerPage) {
url.searchParams.set("Page", state.page);
if (state.perPage != defaultPerPage)
url.searchParams.set("PerPage", state.perPage);
}
else {
url.searchParams.delete("Page");
url.searchParams.delete("PerPage");
}
if (!helpers.shallowEquals(this.showMods, state.defaultMods))
url.searchParams.set("Mods", Object.entries(this.showMods).filter(p => p[1]).map(p => p[0]).join("~"));