From c7847b96041b3c69d7507fec86e0305baa8c86a3 Mon Sep 17 00:00:00 2001 From: FitseTLT Date: Mon, 14 Oct 2024 23:52:54 +0300 Subject: [PATCH] set add pendingField for reportName --- src/libs/actions/Report.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/libs/actions/Report.ts b/src/libs/actions/Report.ts index 13b14d380758..7d93dd72f6bc 100644 --- a/src/libs/actions/Report.ts +++ b/src/libs/actions/Report.ts @@ -837,8 +837,8 @@ function openReport( accountIDList: participantAccountIDList ? participantAccountIDList.join(',') : '', parentReportActionID, }; - - if (ReportUtils.isGroupChat(newReportObject)) { + const isGroupChat = ReportUtils.isGroupChat(newReportObject); + if (isGroupChat) { parameters.chatType = CONST.REPORT.CHAT_TYPE.GROUP; parameters.groupChatAdminLogins = currentUserEmail; parameters.optimisticAccountIDList = Object.keys(newReportObject?.participants ?? {}).join(','); @@ -870,6 +870,7 @@ function openReport( ...newReportObject, pendingFields: { createChat: CONST.RED_BRICK_ROAD_PENDING_ACTION.ADD, + ...(isGroupChat && {reportName: CONST.RED_BRICK_ROAD_PENDING_ACTION.ADD}), }, isOptimisticReport: true, }; @@ -923,6 +924,7 @@ function openReport( participants: redundantParticipants, pendingFields: { createChat: null, + reportName: null, }, errorFields: { createChat: null,