🐛 fix(formModal): handle case when chatKey is undefined to prevent error

This commit is contained in:
Gabriel Luiz Freitas Almeida 2023-07-10 15:47:02 -03:00
commit eecefdb235

View file

@ -554,6 +554,8 @@ export default function FormModal({
setChatValue={(value) => {
setChatValue(value);
setTabsState((old) => {
// chatKey is undefined when there are no chat input keys
if (!chatKey) return old;
let newTabsState = _.cloneDeep(old);
newTabsState[id.current].formKeysData.input_keys[
chatKey