From fbc8686c46cdbbd2884b07ce9c2bad7312a99cbb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marco=20Ch=C3=A1vez?= Date: Mon, 14 Mar 2022 12:55:40 -0600 Subject: [PATCH] use personalDetail.avatar as icon if report does not exist --- src/libs/OptionsListUtils.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/libs/OptionsListUtils.js b/src/libs/OptionsListUtils.js index 23f477618d4c..75ed50475b46 100644 --- a/src/libs/OptionsListUtils.js +++ b/src/libs/OptionsListUtils.js @@ -263,6 +263,7 @@ function createOption(personalDetailList, report, { const tooltipText = ReportUtils.getReportParticipantsTitle(lodashGet(report, ['participants'], [])); const subtitle = ReportUtils.getChatRoomSubtitle(report, policies); + let icons = getAvatarSources(report); let text; let alternateText; if (isChatRoom || isPolicyExpenseChat) { @@ -278,11 +279,15 @@ function createOption(personalDetailList, report, { alternateText = (showChatPreviewLine && lastMessageText) ? lastMessageText : Str.removeSMSDomain(personalDetail.login); + if (!report) { + // If the report doesn't exist then we're creating a list of users to invite (using the personalDetailList) + icons = [personalDetail.avatar]; + } } return { text, alternateText, - icons: getAvatarSources(report), + icons, tooltipText, ownerEmail: lodashGet(report, ['ownerEmail']), subtitle,