Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 9 additions & 5 deletions frontend/src/static/js/components/webstatus-overview-filters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ import {

import {CSVUtils} from '../utils/csv.js';
import {Toast} from '../utils/toast.js';
import {navigateToUrl} from '../utils/app-router.js';

const WEBSTATUS_FEATURE_OVERVIEW_CSV_FILENAME =
'webstatus-feature-overview.csv';
Expand Down Expand Up @@ -229,11 +230,14 @@ export class WebstatusOverviewFilters extends LitElement {
};

gotoFilterQueryString(): void {
const newUrl = formatOverviewPageUrl(this.location, {
q: (this.typeaheadRef.value as WebstatusTypeahead).value,
start: 0,
});
window.location.href = newUrl;
const newUrl = `${window.location.origin}${formatOverviewPageUrl(
this.location,
{
q: (this.typeaheadRef.value as WebstatusTypeahead).value,
start: 0,
},
)}`;
navigateToUrl(newUrl);
}

protected firstUpdated(): void {
Expand Down
5 changes: 5 additions & 0 deletions frontend/src/static/js/utils/app-router.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,11 @@ export const navigateToUrl = (url: string, event?: MouseEvent) => {
return;
}

const currentUrl = window.location.href;
if (currentUrl === url) {
return;
}

// TODO. We should use the vaadin router and use the navigate method there.
window.location.href = url;
};
Expand Down