diff --git a/frontend/src/components/visual-editor/form/inputs/message/QuickRepliesInput.tsx b/frontend/src/components/visual-editor/form/inputs/message/QuickRepliesInput.tsx index 08e90f19e..62e610f20 100644 --- a/frontend/src/components/visual-editor/form/inputs/message/QuickRepliesInput.tsx +++ b/frontend/src/components/visual-editor/form/inputs/message/QuickRepliesInput.tsx @@ -24,6 +24,7 @@ type QuickRepliesInput = { minInput?: number; }; + const QuickRepliesInput: FC = ({ value, onChange, @@ -48,15 +49,7 @@ const QuickRepliesInput: FC = ({ updatedQuickReplies.splice(index, 1); setQuickReplies( - updatedQuickReplies.length - ? updatedQuickReplies - : [ - createValueWithId({ - content_type: QuickReplyType.text, - title: "", - payload: "", - }), - ], + updatedQuickReplies ); }; const updateInput = (index: number) => (p: StdQuickReply) => { @@ -65,7 +58,7 @@ const QuickRepliesInput: FC = ({ }; useEffect(() => { - onChange(quickReplies.map(({ value }) => value)); + onChange(quickReplies.map(({ value }) => value)); // eslint-disable-next-line react-hooks/exhaustive-deps }, [quickReplies]);