Skip to content

Commit

Permalink
Prevent empty query parameter being set on dashboard (go-gitea#11561)
Browse files Browse the repository at this point in the history
Prevent the dashboard from setting an empty query parameter

Fix go-gitea#11543

Signed-off-by: Andrew Thornton [email protected]
  • Loading branch information
zeripath authored and Yohann Delafollye committed Jul 31, 2020
1 parent 9aebef4 commit 399fe30
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion web_src/js/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down

0 comments on commit 399fe30

Please sign in to comment.