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:
parent
c055056460
commit
4fa414c2bd
|
@ -743,11 +743,14 @@ smapi.logParser = function (state) {
|
||||||
updateUrl: function () {
|
updateUrl: function () {
|
||||||
const url = new URL(location);
|
const url = new URL(location);
|
||||||
|
|
||||||
if (state.page != 1)
|
if (state.page != 1 || state.perPage != defaultPerPage) {
|
||||||
url.searchParams.set("Page", state.page);
|
url.searchParams.set("Page", state.page);
|
||||||
|
|
||||||
if (state.perPage != defaultPerPage)
|
|
||||||
url.searchParams.set("PerPage", state.perPage);
|
url.searchParams.set("PerPage", state.perPage);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
url.searchParams.delete("Page");
|
||||||
|
url.searchParams.delete("PerPage");
|
||||||
|
}
|
||||||
|
|
||||||
if (!helpers.shallowEquals(this.showMods, state.defaultMods))
|
if (!helpers.shallowEquals(this.showMods, state.defaultMods))
|
||||||
url.searchParams.set("Mods", Object.entries(this.showMods).filter(p => p[1]).map(p => p[0]).join("~"));
|
url.searchParams.set("Mods", Object.entries(this.showMods).filter(p => p[1]).map(p => p[0]).join("~"));
|
||||||
|
|
Loading…
Reference in New Issue