Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
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 @@ -233,7 +234,7 @@ export class WebstatusOverviewFilters extends LitElement {
q: (this.typeaheadRef.value as WebstatusTypeahead).value,
start: 0,
});
window.location.href = newUrl;
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 oldPath = window.location.pathname + window.location.search;
if (oldPath === url) {
return; // Prevents unnecessary navigation
}

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