@@ -7175,6 +7175,7 @@ type BuildOptimisticChatReportParams = {
71757175 description ?: string ;
71767176 avatarUrl ?: string ;
71777177 optimisticReportID ?: string ;
7178+ isPinned ?: boolean ;
71787179} ;
71797180
71807181function buildOptimisticChatReport ( {
@@ -7193,6 +7194,7 @@ function buildOptimisticChatReport({
71937194 description = '' ,
71947195 avatarUrl = '' ,
71957196 optimisticReportID = '' ,
7197+ isPinned = false ,
71967198} : BuildOptimisticChatReportParams ) : OptimisticChatReport {
71977199 const isWorkspaceChatType = chatType && isWorkspaceChat ( chatType ) ;
71987200 const participants = participantList . reduce ( ( reportParticipants : Participants , accountID : number ) => {
@@ -7209,7 +7211,7 @@ function buildOptimisticChatReport({
72097211 type : CONST . REPORT . TYPE . CHAT ,
72107212 chatType,
72117213 isOwnPolicyExpenseChat,
7212- isPinned : false ,
7214+ isPinned,
72137215 lastActorAccountID : 0 ,
72147216 lastMessageHtml : '' ,
72157217 lastMessageText : undefined ,
@@ -7869,6 +7871,10 @@ function buildOptimisticAnnounceChat(policyID: string, accountIDs: number[]): Op
78697871 } ;
78707872}
78717873
7874+ function shouldPinAdminRoomByDefault ( ) {
7875+ return ! isExpensifyTeam ( currentUserEmail ) ;
7876+ }
7877+
78727878function buildOptimisticWorkspaceChats ( policyID : string , policyName : string , expenseReportId ?: string ) : OptimisticWorkspaceChats {
78737879 const pendingChatMembers = getPendingChatMembers ( currentUserAccountID ? [ currentUserAccountID ] : [ ] , [ ] , CONST . RED_BRICK_ROAD_PENDING_ACTION . ADD ) ;
78747880 const adminsChatData = {
@@ -7879,6 +7885,7 @@ function buildOptimisticWorkspaceChats(policyID: string, policyName: string, exp
78797885 policyID,
78807886 ownerAccountID : CONST . POLICY . OWNER_ACCOUNT_ID_FAKE ,
78817887 oldPolicyName : policyName ,
7888+ isPinned : shouldPinAdminRoomByDefault ( ) ,
78827889 } ) ,
78837890 } ;
78847891 const adminsChatReportID = adminsChatData . reportID ;
0 commit comments