From ca61046f9f1d4f765e48998fd21538c880552787 Mon Sep 17 00:00:00 2001 From: zeripath Date: Sun, 24 May 2020 15:20:09 +0100 Subject: [PATCH] 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 --- 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 c2f154911..0c160319c 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() {