From 7af333f464e95176e825a7841639269dec4786b6 Mon Sep 17 00:00:00 2001 From: Mykhailo Kravchenko Date: Mon, 13 Nov 2023 14:57:29 +0100 Subject: [PATCH] extend a condition to pin a workspace chat --- src/libs/ReportUtils.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/libs/ReportUtils.js b/src/libs/ReportUtils.js index 9f8e138afccd..7942249382d9 100644 --- a/src/libs/ReportUtils.js +++ b/src/libs/ReportUtils.js @@ -2901,12 +2901,13 @@ function buildOptimisticChatReport( welcomeMessage = '', ) { const currentTime = DateUtils.getDBTime(); + const isNewlyCreatedWorkspaceChat = chatType === CONST.REPORT.CHAT_TYPE.POLICY_EXPENSE_CHAT && isOwnPolicyExpenseChat; return { type: CONST.REPORT.TYPE.CHAT, chatType, hasOutstandingIOU: false, isOwnPolicyExpenseChat, - isPinned: reportName === CONST.REPORT.WORKSPACE_CHAT_ROOMS.ADMINS, + isPinned: reportName === CONST.REPORT.WORKSPACE_CHAT_ROOMS.ADMINS || (reportName !== CONST.TEACHERS_UNITE.POLICY_NAME && isNewlyCreatedWorkspaceChat), lastActorAccountID: 0, lastMessageTranslationKey: '', lastMessageHtml: '',