refactor(chatComponent): simplify condition for setting canOpen state in Chat component
The condition for setting the `canOpen` state in the Chat component was simplified by removing unnecessary checks for `formKeysData.input_keys` and `Object.keys(tabsState[flow.id].formKeysData.input_keys).length > 0`. The new condition only checks for the existence of `tabsState[flow.id].formKeysData`. This change improves code readability and reduces unnecessary complexity.
This commit is contained in:
parent
a0aa88f039
commit
7f31f7f519
1 changed files with 1 additions and 7 deletions
|
|
@ -58,13 +58,7 @@ export default function Chat({ flow }: ChatType) {
|
||||||
) {
|
) {
|
||||||
setIsBuilt(false);
|
setIsBuilt(false);
|
||||||
}
|
}
|
||||||
if (
|
if (tabsState && tabsState[flow.id] && tabsState[flow.id].formKeysData) {
|
||||||
tabsState &&
|
|
||||||
tabsState[flow.id] &&
|
|
||||||
tabsState[flow.id].formKeysData &&
|
|
||||||
tabsState[flow.id].formKeysData.input_keys &&
|
|
||||||
Object.keys(tabsState[flow.id].formKeysData.input_keys).length > 0
|
|
||||||
) {
|
|
||||||
setCanOpen(true);
|
setCanOpen(true);
|
||||||
} else {
|
} else {
|
||||||
setCanOpen(false);
|
setCanOpen(false);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue