mirror of
https://github.com/home-assistant/frontend
synced 2024-09-28 00:43:28 +02:00
Fix ZHA visualization page (#13584)
This commit is contained in:
parent
81cc745c0a
commit
f032d0dbcf
@ -60,7 +60,7 @@ class ZHAConfigDashboardRouter extends HassRouterPage {
|
||||
} else if (this._currentPage === "device") {
|
||||
el.ieee = this.routeTail.path.substr(1);
|
||||
} else if (this._currentPage === "visualization") {
|
||||
el.zoomedDeviceId = this.routeTail.path.substr(1);
|
||||
el.zoomedDeviceIdFromURL = this.routeTail.path.substr(1);
|
||||
}
|
||||
|
||||
const searchParams = new URLSearchParams(window.location.search);
|
||||
|
@ -37,7 +37,10 @@ export class ZHANetworkVisualizationPage extends LitElement {
|
||||
@property({ type: Boolean }) public isWide!: boolean;
|
||||
|
||||
@property()
|
||||
public zoomedDeviceId?: string;
|
||||
public zoomedDeviceIdFromURL?: string;
|
||||
|
||||
@state()
|
||||
private zoomedDeviceId?: string;
|
||||
|
||||
@query("#visualization", true)
|
||||
private _visualization?: HTMLElement;
|
||||
@ -64,6 +67,11 @@ export class ZHANetworkVisualizationPage extends LitElement {
|
||||
protected firstUpdated(changedProperties: PropertyValues): void {
|
||||
super.firstUpdated(changedProperties);
|
||||
|
||||
// prevent zoomedDeviceIdFromURL from being restored to zoomedDeviceId after the user clears it
|
||||
if (this.zoomedDeviceIdFromURL) {
|
||||
this.zoomedDeviceId = this.zoomedDeviceIdFromURL;
|
||||
}
|
||||
|
||||
if (this.hass) {
|
||||
this._fetchData();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user