Skip to content

Commit

Permalink
Merge pull request #21696 from daordonez11/hotfix-search-tooltip
Browse files Browse the repository at this point in the history
Hotfix search tooltip
  • Loading branch information
luacmartins authored Jun 29, 2023
2 parents b528d3a + 438a95f commit 3ee1200
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/components/MultipleAvatars.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ function MultipleAvatars(props) {
<UserDetailsTooltip
accountID={props.icons[0].id}
fallbackUserDetails={{
displayName: ReportUtils.getDisplayNameForParticipant(props.icons[0].name),
displayName: ReportUtils.getDisplayNameForParticipant(props.icons[0].id),
login: lodashGet(props.icons[0], 'name', tooltipTexts[0]),
avatar: lodashGet(props.icons[0], 'source', ''),
}}
Expand Down
2 changes: 1 addition & 1 deletion src/libs/OptionsListUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -521,7 +521,7 @@ function createOption(accountIDs, personalDetails, report, reportActions = {}, {

result.text = reportName;
result.searchText = getSearchText(report, reportName, personalDetailList, result.isChatRoom || result.isPolicyExpenseChat, result.isThread);
result.icons = ReportUtils.getIcons(report, personalDetails, UserUtils.getAvatar(personalDetail.avatar, personalDetail.accountID));
result.icons = ReportUtils.getIcons(report, personalDetails, UserUtils.getAvatar(personalDetail.avatar, personalDetail.accountID), false, personalDetail.login, personalDetail.accountID);
result.subtitle = subtitle;

return result;
Expand Down
6 changes: 5 additions & 1 deletion src/libs/ReportUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -717,9 +717,11 @@ function getIconsForParticipants(participants, personalDetails) {
* @param {Object} personalDetails
* @param {*} [defaultIcon]
* @param {Boolean} [isPayer]
* @param {String} [defaultName]
* @param {Number} [defaultAccountID]
* @returns {Array<*>}
*/
function getIcons(report, personalDetails, defaultIcon = null, isPayer = false) {
function getIcons(report, personalDetails, defaultIcon = null, isPayer = false, defaultName = '', defaultAccountID = undefined) {
const result = {
source: '',
type: CONST.ICON_TYPE_AVATAR,
Expand All @@ -728,6 +730,8 @@ function getIcons(report, personalDetails, defaultIcon = null, isPayer = false)

if (_.isEmpty(report)) {
result.source = defaultIcon || Expensicons.FallbackAvatar;
result.name = defaultName || '';
result.id = defaultAccountID;
return [result];
}
if (isArchivedRoom(report)) {
Expand Down

0 comments on commit 3ee1200

Please sign in to comment.