From 058da1b2ec4ac553bfefa60ca151910582de603e Mon Sep 17 00:00:00 2001 From: Himali Malvawala <86650000+Himali-Malvawala@users.noreply.github.com> Date: Thu, 13 Jun 2024 19:23:11 +0530 Subject: [PATCH] fix: create conversation when message is present (#277) --- src/tasks/components/NewTask.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/tasks/components/NewTask.tsx b/src/tasks/components/NewTask.tsx index d8fcc4aa..b556163a 100644 --- a/src/tasks/components/NewTask.tsx +++ b/src/tasks/components/NewTask.tsx @@ -38,7 +38,7 @@ export const NewTask = (props: Props) => { const handleSave = async () => { if (validate()) { const tasks = await ApiHelper.post("/tasks", [task], "DoingApi"); - if (message.content?.trim() !== "") { + if (message.content && (message.content?.trim() !== undefined || message.content?.trim() !== "")) { const conv: ConversationInterface = { allowAnonymousPosts: false, contentType: "task", contentId: task.id, title: "Task #" + tasks[0].id + " Notes", visibility: "hidden" } const result: ConversationInterface[] = await ApiHelper.post("/conversations", [conv], "MessagingApi"); @@ -49,8 +49,8 @@ export const NewTask = (props: Props) => { message.conversationId = t.conversationId; //message.contentId = tasks[0].id; await ApiHelper.post("/messages", [message], "MessagingApi"); - props.onSave(); } + props.onSave(); } }