Don't check for promise when processing DataEntryFlowStep (#23759)

This commit is contained in:
Matthias Alphart 2025-01-23 12:27:19 +01:00 committed by GitHub
parent fb79e2cfb2
commit caeb616dc6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -312,10 +312,15 @@ class DataEntryFlowDialog extends LitElement {
private async _processStep( private async _processStep(
step: DataEntryFlowStep | undefined | Promise<DataEntryFlowStep> step: DataEntryFlowStep | undefined | Promise<DataEntryFlowStep>
): Promise<void> { ): Promise<void> {
if (step instanceof Promise) { if (step === undefined) {
this.closeDialog();
return;
}
this._loading = "loading_step"; this._loading = "loading_step";
let _step: DataEntryFlowStep;
try { try {
this._step = await step; _step = await step;
} catch (err: any) { } catch (err: any) {
this.closeDialog(); this.closeDialog();
showAlertDialog(this, { showAlertDialog(this, {
@ -328,16 +333,10 @@ class DataEntryFlowDialog extends LitElement {
} finally { } finally {
this._loading = undefined; this._loading = undefined;
} }
return;
}
if (step === undefined) {
this.closeDialog();
return;
}
this._step = undefined; this._step = undefined;
await this.updateComplete; await this.updateComplete;
this._step = step; this._step = _step;
} }
private async _subscribeDataEntryFlowProgressed() { private async _subscribeDataEntryFlowProgressed() {