Skip to content

Commit

Permalink
Include query params in url when default page is added (#23880)
Browse files Browse the repository at this point in the history
Include query params if exists
  • Loading branch information
silamon authored Jan 25, 2025
1 parent 77fc11c commit 240e48f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/layouts/hass-router-page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,10 @@ export class HassRouterPage extends ReactiveElement {
const defaultPage = routerOptions.defaultPage;

if (route && route.path === "" && defaultPage !== undefined) {
navigate(`${route.prefix}/${defaultPage}`, { replace: true });
const queryParams = window.location.search;
navigate(`${route.prefix}/${defaultPage}${queryParams}`, {
replace: true,
});
}

let newPage = route
Expand Down

0 comments on commit 240e48f

Please sign in to comment.