mirror of
https://github.com/home-assistant/frontend.git
synced 2026-02-04 01:10:33 -06:00
Fix add entry button for integrations (#29106)
This commit is contained in:
parent
3364d4f578
commit
a3be09018c
@ -105,10 +105,19 @@ class AddIntegrationDialog extends LitElement {
|
||||
const loadPromise = this._load();
|
||||
|
||||
if (params?.domain) {
|
||||
// Just open the config flow dialog, do not show this dialog
|
||||
// If we get here we clicked the button to add an entry for a specific integration
|
||||
// If there is discovery in process, show this dialog to select a new flow
|
||||
// or continue an existing flow.
|
||||
// If no flow in process, just open the config flow dialog directly
|
||||
await loadPromise;
|
||||
await this._createFlow(params.domain);
|
||||
return;
|
||||
const flowsInProgress = this._getFlowsInProgressForDomains([
|
||||
params.domain,
|
||||
]);
|
||||
|
||||
if (!flowsInProgress.length) {
|
||||
await this._createFlow(params.domain);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (params?.brand === "_discovered") {
|
||||
@ -117,10 +126,12 @@ class AddIntegrationDialog extends LitElement {
|
||||
this._showDiscovered = true;
|
||||
}
|
||||
|
||||
// Only open the dialog if no domain is provided
|
||||
// Only open the dialog if no domain is provided or we need to select a flow
|
||||
this._open = true;
|
||||
this._pickedBrand =
|
||||
params?.brand === "_discovered" ? undefined : params?.brand;
|
||||
params?.brand === "_discovered"
|
||||
? undefined
|
||||
: params?.domain || params?.brand;
|
||||
this._initialFilter = params?.initialFilter;
|
||||
this._navigateToResult = params?.navigateToResult ?? false;
|
||||
this._narrow = matchMedia(
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user