Skip to content

Commit 1dc9b69

Browse files
committed
Use complete url instead of path
1 parent 4cfe1ca commit 1dc9b69

File tree

2 files changed

+10
-7
lines changed

2 files changed

+10
-7
lines changed

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

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -230,10 +230,13 @@ export class WebstatusOverviewFilters extends LitElement {
230230
};
231231

232232
gotoFilterQueryString(): void {
233-
const newUrl = formatOverviewPageUrl(this.location, {
234-
q: (this.typeaheadRef.value as WebstatusTypeahead).value,
235-
start: 0,
236-
});
233+
const newUrl = `${window.location.origin}${formatOverviewPageUrl(
234+
this.location,
235+
{
236+
q: (this.typeaheadRef.value as WebstatusTypeahead).value,
237+
start: 0,
238+
},
239+
)}`;
237240
navigateToUrl(newUrl);
238241
}
239242

frontend/src/static/js/utils/app-router.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,9 @@ export const navigateToUrl = (url: string, event?: MouseEvent) => {
5555
return;
5656
}
5757

58-
const oldPath = window.location.pathname + window.location.search;
59-
if (oldPath === url) {
60-
return; // Prevents unnecessary navigation
58+
const currentUrl = window.location.href;
59+
if (currentUrl === url) {
60+
return;
6161
}
6262

6363
// TODO. We should use the vaadin router and use the navigate method there.

0 commit comments

Comments
 (0)