From fb3c94f4039bda8f235a50837321b657caa1d00f Mon Sep 17 00:00:00 2001 From: karwosts <32912880+karwosts@users.noreply.github.com> Date: Tue, 27 Feb 2024 09:24:42 -0500 Subject: [PATCH] Improve map/zone navigation (#19740) * Improve map/zone navigation * dont remove tabs --- src/panels/config/zone/ha-config-zone.ts | 6 +++++- src/panels/map/ha-panel-map.ts | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/panels/config/zone/ha-config-zone.ts b/src/panels/config/zone/ha-config-zone.ts index bf56ed7ce5..2455bf2b48 100644 --- a/src/panels/config/zone/ha-config-zone.ts +++ b/src/panels/config/zone/ha-config-zone.ts @@ -58,6 +58,8 @@ export class HaConfigZone extends SubscribeMixin(LitElement) { @property({ attribute: false }) public route!: Route; + @state() private _searchParms = new URLSearchParams(window.location.search); + @state() private _storageItems?: Zone[]; @state() private _stateItems?: HassEntity[]; @@ -219,7 +221,9 @@ export class HaConfigZone extends SubscribeMixin(LitElement) { .hass=${this.hass} .narrow=${this.narrow} .route=${this.route} - back-path="/config" + .backPath=${this._searchParms.has("historyBack") + ? undefined + : "/config"} .tabs=${configSections.areas} > ${this.narrow diff --git a/src/panels/map/ha-panel-map.ts b/src/panels/map/ha-panel-map.ts index b7698ca186..d6c1cbd1fb 100644 --- a/src/panels/map/ha-panel-map.ts +++ b/src/panels/map/ha-panel-map.ts @@ -46,7 +46,7 @@ class HaPanelMap extends LitElement { } private _openZonesEditor() { - navigate("/config/zone"); + navigate("/config/zone?historyBack=1"); } public willUpdate(changedProps: PropertyValues) {