Improve map/zone navigation (#19740)

* Improve map/zone navigation

* dont remove tabs
This commit is contained in:
karwosts 2024-02-27 09:24:42 -05:00 committed by GitHub
parent dd8c1d359c
commit fb3c94f403
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 6 additions and 2 deletions

View File

@ -58,6 +58,8 @@ export class HaConfigZone extends SubscribeMixin(LitElement) {
@property({ attribute: false }) public route!: Route; @property({ attribute: false }) public route!: Route;
@state() private _searchParms = new URLSearchParams(window.location.search);
@state() private _storageItems?: Zone[]; @state() private _storageItems?: Zone[];
@state() private _stateItems?: HassEntity[]; @state() private _stateItems?: HassEntity[];
@ -219,7 +221,9 @@ export class HaConfigZone extends SubscribeMixin(LitElement) {
.hass=${this.hass} .hass=${this.hass}
.narrow=${this.narrow} .narrow=${this.narrow}
.route=${this.route} .route=${this.route}
back-path="/config" .backPath=${this._searchParms.has("historyBack")
? undefined
: "/config"}
.tabs=${configSections.areas} .tabs=${configSections.areas}
> >
${this.narrow ${this.narrow

View File

@ -46,7 +46,7 @@ class HaPanelMap extends LitElement {
} }
private _openZonesEditor() { private _openZonesEditor() {
navigate("/config/zone"); navigate("/config/zone?historyBack=1");
} }
public willUpdate(changedProps: PropertyValues) { public willUpdate(changedProps: PropertyValues) {