Skip to content

Commit 788b8b1

Browse files
authored
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
1 parent ae55dc7 commit 788b8b1

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

web_src/js/index.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2852,7 +2852,12 @@ function initVueComponents() {
28522852
params.set('repo-search-page', `${this.page}`);
28532853
}
28542854

2855-
window.history.replaceState({}, '', `?${params.toString()}`);
2855+
const queryString = params.toString();
2856+
if (queryString) {
2857+
window.history.replaceState({}, '', `?${queryString}`);
2858+
} else {
2859+
window.history.replaceState({}, '', window.location.pathname);
2860+
}
28562861
},
28572862

28582863
toggleArchivedFilter() {

0 commit comments

Comments
 (0)