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
This commit is contained in:
zeripath 2020-05-24 15:20:09 +01:00 committed by GitHub
parent 29368309ce
commit ca61046f9f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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() {