From f1139e09f90b18f298781985a92d1c3a8ea41fc5 Mon Sep 17 00:00:00 2001 From: Bram Kragten Date: Tue, 25 Oct 2022 15:15:18 +0200 Subject: [PATCH] Fix back handling of add integration dialog (#14187) --- .../config/integrations/dialog-add-integration.ts | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/panels/config/integrations/dialog-add-integration.ts b/src/panels/config/integrations/dialog-add-integration.ts index 10a9802934..ad3a8ae3ad 100644 --- a/src/panels/config/integrations/dialog-add-integration.ts +++ b/src/panels/config/integrations/dialog-add-integration.ts @@ -69,6 +69,8 @@ class AddIntegrationDialog extends LitElement { @state() private _pickedBrand?: string; + @state() private _prevPickedBrand?: string; + @state() private _flowsInProgress?: DataEntryFlowProgress[]; @state() private _open = false; @@ -94,6 +96,7 @@ class AddIntegrationDialog extends LitElement { this._integrations = undefined; this._helpers = undefined; this._pickedBrand = undefined; + this._prevPickedBrand = undefined; this._flowsInProgress = undefined; this._filter = undefined; this._width = undefined; @@ -327,6 +330,7 @@ class AddIntegrationDialog extends LitElement { } private _handleSelectBrandEvent(ev: CustomEvent) { + this._prevPickedBrand = this._pickedBrand; this._pickedBrand = ev.detail.brand; } @@ -589,8 +593,11 @@ class AddIntegrationDialog extends LitElement { } private _prevClicked() { - this._pickedBrand = undefined; - this._flowsInProgress = undefined; + this._pickedBrand = this._prevPickedBrand; + if (!this._prevPickedBrand) { + this._flowsInProgress = undefined; + } + this._prevPickedBrand = undefined; } static styles = [