@@ -405,17 +405,6 @@ function isOptimisticPersonalDetail(accountID) {
405
405
return _ . isEmpty ( allPersonalDetails [ accountID ] ) || ! ! allPersonalDetails [ accountID ] . isOptimisticPersonalDetail ;
406
406
}
407
407
408
- /**
409
- * Check if report is a DM and personal detail of participant is optimistic data
410
- * @param {String } report
411
- * @returns {Boolean }
412
- */
413
- function shouldDisableDetailPage ( report ) {
414
- const participants = lodashGet ( report , 'participantAccountIDs' , [ ] ) ;
415
- const isMultipleParticipant = participants . length > 1 ;
416
- return ! isMultipleParticipant && isOptimisticPersonalDetail ( participants [ 0 ] ) && ! report . parentReportID ;
417
- }
418
-
419
408
/**
420
409
* Checks if a report is a task report from a policy expense chat.
421
410
*
@@ -461,6 +450,38 @@ function isConciergeChatReport(report) {
461
450
}
462
451
463
452
/**
453
+ <<<<<<< HEAD
454
+ =======
455
+ * Check if the report is a single chat report that isn't a thread
456
+ * and personal detail of participant is optimistic data
457
+ * @param {Object } report
458
+ * @param {Array } report.participantAccountIDs
459
+ * @returns {Boolean }
460
+ */
461
+ function shouldDisableDetailPage ( report ) {
462
+ const participantAccountIDs = lodashGet ( report , 'participantAccountIDs' , [ ] ) ;
463
+
464
+ if ( isChatRoom ( report ) || isPolicyExpenseChat ( report ) || isChatThread ( report ) ) {
465
+ return false ;
466
+ }
467
+ if ( participantAccountIDs . length === 1 ) {
468
+ return isOptimisticPersonalDetail ( participantAccountIDs [ 0 ] ) ;
469
+ }
470
+ return false ;
471
+ }
472
+
473
+ /**
474
+ * Returns true if this report has only one participant and it's an Expensify account.
475
+ * @param {Object } report
476
+ * @returns {Boolean }
477
+ */
478
+ function isExpensifyOnlyParticipantInReport ( report ) {
479
+ const reportParticipants = _ . without ( lodashGet ( report , 'participantAccountIDs' , [ ] ) , currentUserAccountID ) ;
480
+ return lodashGet ( report , 'participantAccountIDs' , [ ] ) . length === 1 && _ . some ( reportParticipants , ( accountID ) => _ . contains ( CONST . EXPENSIFY_ACCOUNT_IDS , accountID ) ) ;
481
+ }
482
+
483
+ /**
484
+ >>>>>>> a67e8af (Merge pull request #24091 from dukenv0307/fix/22691-regression)
464
485
* Returns true if there are any Expensify accounts (i.e. with domain 'expensify.com') in the set of accountIDs
465
486
* by cross-referencing the accountIDs with personalDetails.
466
487
*
0 commit comments