Option flows dont have result (#8787)

This commit is contained in:
Bram Kragten 2021-04-02 00:11:15 +02:00 committed by GitHub
parent 334196799a
commit 01be5243de
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 3 deletions

View File

@ -45,7 +45,7 @@ export interface DataEntryFlowStepCreateEntry {
flow_id: string;
handler: string;
title: string;
result: ConfigEntry;
result?: ConfigEntry;
description: string;
description_placeholders: Record<string, string>;
}

View File

@ -314,7 +314,7 @@ class DataEntryFlowDialog extends LitElement {
this._step &&
this._step.type === "create_entry"
) {
if (this._params!.flowConfig.loadDevicesAndAreas) {
if (this._step.result && this._params!.flowConfig.loadDevicesAndAreas) {
this._fetchDevices(this._step.result.entry_id);
this._fetchAreas();
} else {

View File

@ -43,7 +43,7 @@ class StepFlowCreateEntry extends LitElement {
<h2>Success!</h2>
<div class="content">
${this.flowConfig.renderCreateEntryDescription(this.hass, this.step)}
${this.step.result.state === "not_loaded"
${this.step.result?.state === "not_loaded"
? html`<span class="error"
>${localize(
"ui.panel.config.integrations.config_flow.not_loaded"