From 7af333f464e95176e825a7841639269dec4786b6 Mon Sep 17 00:00:00 2001 From: Mykhailo Kravchenko Date: Mon, 13 Nov 2023 14:57:29 +0100 Subject: [PATCH 1/2] 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: '', From c0c8580584227badfa13ca190201a5fa2fd1ef18 Mon Sep 17 00:00:00 2001 From: Mykhailo Kravchenko Date: Mon, 20 Nov 2023 16:02:40 +0100 Subject: [PATCH 2/2] simplify condition --- src/libs/ReportUtils.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libs/ReportUtils.js b/src/libs/ReportUtils.js index cf4ebf81fedc..820e21583dbc 100644 --- a/src/libs/ReportUtils.js +++ b/src/libs/ReportUtils.js @@ -2947,7 +2947,7 @@ function buildOptimisticChatReport( chatType, hasOutstandingIOU: false, isOwnPolicyExpenseChat, - isPinned: reportName === CONST.REPORT.WORKSPACE_CHAT_ROOMS.ADMINS || (reportName !== CONST.TEACHERS_UNITE.POLICY_NAME && isNewlyCreatedWorkspaceChat), + isPinned: reportName === CONST.REPORT.WORKSPACE_CHAT_ROOMS.ADMINS || isNewlyCreatedWorkspaceChat, lastActorAccountID: 0, lastMessageTranslationKey: '', lastMessageHtml: '',