Skip to content

Commit 7016a65

Browse files
committed
Prevent page refresh if present result is same as result to be searched
1 parent 7a2077b commit 7016a65

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

frontend/src/static/js/components/webstatus-overview-filters.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -229,11 +229,16 @@ export class WebstatusOverviewFilters extends LitElement {
229229
};
230230

231231
gotoFilterQueryString(): void {
232-
const newUrl = formatOverviewPageUrl(this.location, {
232+
const oldPath = window.location.pathname + window.location.search;
233+
234+
const newPath = formatOverviewPageUrl(this.location, {
233235
q: (this.typeaheadRef.value as WebstatusTypeahead).value,
234236
start: 0,
235237
});
236-
window.location.href = newUrl;
238+
239+
if (oldPath !== newPath) {
240+
window.location.href = newPath;
241+
}
237242
}
238243

239244
protected firstUpdated(): void {

0 commit comments

Comments
 (0)