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 committed May 24, 2020
1 parent 2936830 commit 9828ce1
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 @@ -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() {
Expand Down

0 comments on commit 9828ce1

Please sign in to comment.