@@ -3399,6 +3399,7 @@ function getReportActionAvatars({
33993399 const isWorkspaceChatWithoutChatReport = ! chatReport && isAWorkspaceChat ;
34003400 // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
34013401 const usePersonalDetailsAvatars = ( isChatReportOnlyProp || isWorkspaceChatWithoutChatReport ) && isReportPreviewOrNoAction && ! isATripPreview ;
3402+ const useNearestReportAvatars = ( ! accountID || ! action ) && accountIDs . length === 0 ;
34023403
34033404 const getIconsWithDefaults = ( report : OnyxInputOrEntry < Report > ) =>
34043405 getIcons ( report , personalDetails , avatar ?? fallbackIcon ?? FallbackAvatar , defaultDisplayName , accountID , policy , invoiceReceiverPolicy ) ;
@@ -3407,7 +3408,9 @@ function getReportActionAvatars({
34073408
34083409 let primaryAvatar ;
34093410
3410- if ( isWorkspaceActor || usePersonalDetailsAvatars ) {
3411+ if ( useNearestReportAvatars ) {
3412+ primaryAvatar = getIconsWithDefaults ( iouReport ?? chatReport ) . at ( 0 ) ;
3413+ } else if ( isWorkspaceActor || usePersonalDetailsAvatars ) {
34113414 primaryAvatar = reportIcons . at ( 0 ) ;
34123415 } else if ( delegatePersonalDetails ) {
34133416 primaryAvatar = getIconsWithDefaults ( iouReport ) . at ( 0 ) ;
@@ -3426,7 +3429,9 @@ function getReportActionAvatars({
34263429
34273430 let secondaryAvatar ;
34283431
3429- if ( usePersonalDetailsAvatars ) {
3432+ if ( useNearestReportAvatars ) {
3433+ secondaryAvatar = getIconsWithDefaults ( iouReport ?? chatReport ) . at ( 1 ) ;
3434+ } else if ( usePersonalDetailsAvatars ) {
34303435 secondaryAvatar = reportIcons . at ( 1 ) ;
34313436 } else if ( isATripPreview ) {
34323437 secondaryAvatar = reportIcons . at ( 0 ) ;
0 commit comments