diff options
author | zeripath <art27@cantab.net> | 2020-05-24 14:02:16 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-05-24 14:02:16 +0100 |
commit | 788b8b1440462d477f45b0088875b66f09da25d4 (patch) | |
tree | 38dcb69f5bd39ad999e3a59a5f8f52c4d849d63d /web_src/js/index.js | |
parent | ae55dc7a6ba9c08c4a8e0750acf89f9ad3fabffb (diff) | |
download | gitea-788b8b1440462d477f45b0088875b66f09da25d4.tar.gz gitea-788b8b1440462d477f45b0088875b66f09da25d4.zip |
Prevent empty query parameter being set on dashboard (#11561)
Prevent the dashboard from setting an empty query parameter
Fix #11543
Signed-off-by: Andrew Thornton art27@cantab.net
Diffstat (limited to 'web_src/js/index.js')
-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 553948bb36..32265748a5 100644 --- a/web_src/js/index.js +++ b/web_src/js/index.js @@ -2852,7 +2852,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() { |