diff --git a/src/panels/config/integrations/dialog-add-integration.ts b/src/panels/config/integrations/dialog-add-integration.ts index f1932b8847..5161016631 100644 --- a/src/panels/config/integrations/dialog-add-integration.ts +++ b/src/panels/config/integrations/dialog-add-integration.ts @@ -97,15 +97,12 @@ class AddIntegrationDialog extends LitElement { public async showDialog(params?: AddIntegrationDialogParams): Promise { const loadPromise = this._load(); - this._open = true; - this._pickedBrand = params?.brand; - this._initialFilter = params?.initialFilter; - this._narrow = matchMedia( - "all and (max-width: 450px), all and (max-height: 500px)" - ).matches; if (params?.domain) { - this._createFlow(params.domain); + // Just open the config flow dialog, do not show this dialog + await this._createFlow(params.domain); + return; } + if (params?.brand) { await loadPromise; const brand = this._integrations?.[params.brand]; @@ -113,6 +110,13 @@ class AddIntegrationDialog extends LitElement { this._fetchFlowsInProgress(Object.keys(brand.integrations)); } } + // Only open the dialog if no domain is provided + this._open = true; + this._pickedBrand = params?.brand; + this._initialFilter = params?.initialFilter; + this._narrow = matchMedia( + "all and (max-width: 450px), all and (max-height: 500px)" + ).matches; } public closeDialog() {