diff options
author | zeripath <art27@cantab.net> | 2020-05-24 15:20:09 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-05-24 17:20:09 +0300 |
commit | ca61046f9f1d4f765e48998fd21538c880552787 (patch) | |
tree | 3c52114dd75e488665e5d47f03cc49644aa822f3 | |
parent | 29368309ce534b608bd95696835d0a989cf5564d (diff) | |
download | gitea-ca61046f9f1d4f765e48998fd21538c880552787.tar.gz gitea-ca61046f9f1d4f765e48998fd21538c880552787.zip |
Prevent empty query parameter being set on dashboard (#11561) (#11604)
Prevent the dashboard from setting an empty query parameter
Fix #11543
Signed-off-by: Andrew Thornton art27@cantab.net
-rw-r--r-- | web_src/js/index.js | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/web_src/js/index.js b/web_src/js/index.js index c2f1549110..0c160319c3 100644 --- a/web_src/js/index.js +++ b/web_src/js/index.js @@ -2854,7 +2854,12 @@ function initVueComponents() { params.set('repo-search-page', `${this.page}`); } - window.history.replaceState({}, '', `?${params.toString()}`); + const queryString = params.toString(); + if (queryString) { + window.history.replaceState({}, '', `?${queryString}`); + } else { + window.history.replaceState({}, '', window.location.pathname); + } }, toggleArchivedFilter() { |