Fix back handling of add integration dialog (#14187)

This commit is contained in:
Bram Kragten 2022-10-25 15:15:18 +02:00 committed by GitHub
parent 51febc2218
commit f1139e09f9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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,9 +593,12 @@ class AddIntegrationDialog extends LitElement {
}
private _prevClicked() {
this._pickedBrand = undefined;
this._pickedBrand = this._prevPickedBrand;
if (!this._prevPickedBrand) {
this._flowsInProgress = undefined;
}
this._prevPickedBrand = undefined;
}
static styles = [
haStyleScrollbar,