refactor(utils.ts): simplify logic for getting chat input field
The logic for getting the chat input field has been simplified by removing unnecessary checks and using optional chaining. This improves readability and reduces the complexity of the code.
This commit is contained in:
parent
af218867eb
commit
57f580c93d
1 changed files with 2 additions and 1 deletions
|
|
@ -280,12 +280,13 @@ export function getChatInputField(flow: FlowType, tabsState?: TabsState) {
|
|||
let chat_input_field = "text";
|
||||
|
||||
if (
|
||||
tabsState &&
|
||||
tabsState[flow.id] &&
|
||||
tabsState[flow.id].formKeysData &&
|
||||
tabsState[flow.id].formKeysData.input_keys
|
||||
) {
|
||||
chat_input_field = Object.keys(
|
||||
tabsState[flow.id].formKeysData.input_keys
|
||||
tabsState[flow.id].formKeysData.input_keys!
|
||||
)[0];
|
||||
}
|
||||
return chat_input_field;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue