Skip to content

Commit 399fe30

Browse files
zeripathYohann Delafollye
authored andcommitted
Prevent empty query parameter being set on dashboard (go-gitea#11561)
Prevent the dashboard from setting an empty query parameter Fix go-gitea#11543 Signed-off-by: Andrew Thornton art27@cantab.net
1 parent 9aebef4 commit 399fe30

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)