mirror of
https://github.com/home-assistant/frontend.git
synced 2025-11-10 11:30:01 +00:00
Add if replace was used when sending navigation events (#2970)
This commit is contained in:
@@ -1,5 +1,14 @@
|
||||
import { fireEvent } from "./dom/fire_event";
|
||||
|
||||
declare global {
|
||||
// for fire event
|
||||
interface HASSDomEvents {
|
||||
"location-changed": {
|
||||
replace: boolean;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
export const navigate = (
|
||||
_node: any,
|
||||
path: string,
|
||||
@@ -18,5 +27,7 @@ export const navigate = (
|
||||
history.pushState(null, "", path);
|
||||
}
|
||||
}
|
||||
fireEvent(window, "location-changed");
|
||||
fireEvent(window, "location-changed", {
|
||||
replace,
|
||||
});
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user