🐛 fix(chatComponent): add null check for formKeysData.input_keys to prevent error when accessing undefined property

This commit is contained in:
Gabriel Luiz Freitas Almeida 2023-08-07 20:32:27 -03:00
commit bd7489206d

View file

@ -58,7 +58,12 @@ export default function Chat({ flow }: ChatType) {
) {
setIsBuilt(false);
}
if (tabsState && tabsState[flow.id] && tabsState[flow.id].formKeysData) {
if (
tabsState &&
tabsState[flow.id] &&
tabsState[flow.id].formKeysData &&
tabsState[flow.id].formKeysData.input_keys !== null
) {
setCanOpen(true);
} else {
setCanOpen(false);