mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-23 17:26:42 +00:00
Fix rendering of a choose without any action taken (#8952)
This commit is contained in:
parent
0b8d356865
commit
5f78f18cb4
@ -314,16 +314,18 @@ class ActionRenderer {
|
|||||||
|
|
||||||
if (defaultExecuted) {
|
if (defaultExecuted) {
|
||||||
this._renderEntry(choosePath, `${name}: Default action executed`);
|
this._renderEntry(choosePath, `${name}: Default action executed`);
|
||||||
} else {
|
} else if (chooseTrace.result) {
|
||||||
const choiceConfig = this._getDataFromPath(
|
const choiceConfig = this._getDataFromPath(
|
||||||
`${this.keys[index]}/choose/${chooseTrace.result?.choice}`
|
`${this.keys[index]}/choose/${chooseTrace.result.choice}`
|
||||||
) as ChooseActionChoice | undefined;
|
) as ChooseActionChoice | undefined;
|
||||||
const choiceName = choiceConfig
|
const choiceName = choiceConfig
|
||||||
? `${
|
? `${
|
||||||
choiceConfig.alias || `Choice ${chooseTrace.result?.choice}`
|
choiceConfig.alias || `Choice ${chooseTrace.result.choice}`
|
||||||
} executed`
|
} executed`
|
||||||
: `Error: ${chooseTrace.error}`;
|
: `Error: ${chooseTrace.error}`;
|
||||||
this._renderEntry(choosePath, `${name}: ${choiceName}`);
|
this._renderEntry(choosePath, `${name}: ${choiceName}`);
|
||||||
|
} else {
|
||||||
|
this._renderEntry(choosePath, `${name}: No action taken`);
|
||||||
}
|
}
|
||||||
|
|
||||||
let i;
|
let i;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user