From 788b8b1440462d477f45b0088875b66f09da25d4 Mon Sep 17 00:00:00 2001 From: zeripath Date: Sun, 24 May 2020 14:02:16 +0100 Subject: [PATCH] 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 --- web_src/js/index.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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() {