summaryrefslogtreecommitdiff
path: root/src/SMAPI.Web/wwwroot/Content/js/log-parser.js
diff options
context:
space:
mode:
authorJesse Plamondon-Willard <Pathoschild@users.noreply.github.com>2022-04-21 20:59:35 -0400
committerJesse Plamondon-Willard <Pathoschild@users.noreply.github.com>2022-04-21 20:59:35 -0400
commit4fa414c2bd5ddb452c0560d00e0d4f1d383c1d8b (patch)
treed8daaf8ec431b0b13b8d00901bda0268a72f895b /src/SMAPI.Web/wwwroot/Content/js/log-parser.js
parentc05505646048d8f7aaabfb65bd1e789e94857d65 (diff)
downloadSMAPI-4fa414c2bd5ddb452c0560d00e0d4f1d383c1d8b.tar.gz
SMAPI-4fa414c2bd5ddb452c0560d00e0d4f1d383c1d8b.tar.bz2
SMAPI-4fa414c2bd5ddb452c0560d00e0d4f1d383c1d8b.zip
set page/perPage URL args together
Since there's no UI to set the page size, this makes the argument more discoverable.
Diffstat (limited to 'src/SMAPI.Web/wwwroot/Content/js/log-parser.js')
-rw-r--r--src/SMAPI.Web/wwwroot/Content/js/log-parser.js9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/SMAPI.Web/wwwroot/Content/js/log-parser.js b/src/SMAPI.Web/wwwroot/Content/js/log-parser.js
index 3fb5fd6c..fccd00be 100644
--- a/src/SMAPI.Web/wwwroot/Content/js/log-parser.js
+++ b/src/SMAPI.Web/wwwroot/Content/js/log-parser.js
@@ -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("~"));