From 604cb3da9ea32de8972aec086ba1190fa3c71f94 Mon Sep 17 00:00:00 2001 From: Yevhenii Voloshchak Date: Mon, 18 Jul 2022 23:46:45 +0300 Subject: [PATCH] Generate default avatar of random color for all the users --- src/libs/OptionsListUtils.js | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/libs/OptionsListUtils.js b/src/libs/OptionsListUtils.js index 53ae93cf8b74..ad98e8fac8f5 100644 --- a/src/libs/OptionsListUtils.js +++ b/src/libs/OptionsListUtils.js @@ -89,10 +89,6 @@ Onyx.connect({ }, }); -// We are initializing a default avatar here so that we use the same default color for each user we are inviting. This -// will update when the OptionsListUtils re-loads. But will stay the same color for the life of the JS session. -const defaultAvatarForUserToInvite = ReportUtils.getDefaultAvatar(); - /** * Adds expensify SMS domain (@expensify.sms) if login is a phone number and if it's not included yet * @@ -591,7 +587,7 @@ function getOptions(reports, personalDetails, activeReportID, { userToInvite = createOption([login], personalDetails, null, { showChatPreviewLine, }); - userToInvite.icons = [defaultAvatarForUserToInvite]; + userToInvite.icons = [ReportUtils.getDefaultAvatar(login)]; } // If we are prioritizing 1:1 chats in search, do it only once we started searching