From aca4a1f86dd48be14eb4263d47c8609521429a23 Mon Sep 17 00:00:00 2001 From: Chai <3500928+phiychai@users.noreply.github.com> Date: Fri, 25 Jul 2025 12:42:34 +0100 Subject: [PATCH] Fix for integration 'Add entry' unnecessary dialogs (#26285) --- .../integrations/dialog-add-integration.ts | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) 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() {