Skip to content

Commit

Permalink
fix(searchtooltip): Support login to accountid migration PR21026
Browse files Browse the repository at this point in the history
  • Loading branch information
daordonez11 committed Jun 28, 2023
1 parent cdfc707 commit 619394d
Show file tree
Hide file tree
Showing 3 changed files with 5 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 @@ -516,7 +516,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), false, personalDetail.login);
result.icons = ReportUtils.getIcons(report, personalDetails, UserUtils.getAvatar(personalDetail.avatar, personalDetail.accountID), false, personalDetail.login, personalDetail.accountID);
result.subtitle = subtitle;

return result;
Expand Down
4 changes: 3 additions & 1 deletion src/libs/ReportUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -712,9 +712,10 @@ function getIconsForParticipants(participants, personalDetails) {
* @param {*} [defaultIcon]
* @param {Boolean} [isPayer]
* @param {String} [defaultName]
* @param {Number} [defaultID]
* @returns {Array<*>}
*/
function getIcons(report, personalDetails, defaultIcon = null, isPayer = false, defaultName = '') {
function getIcons(report, personalDetails, defaultIcon = null, isPayer = false, defaultName = '', defaultID = undefined) {
const result = {
source: '',
type: CONST.ICON_TYPE_AVATAR,
Expand All @@ -724,6 +725,7 @@ function getIcons(report, personalDetails, defaultIcon = null, isPayer = false,
if (_.isEmpty(report)) {
result.source = defaultIcon || Expensicons.FallbackAvatar;
result.name = defaultName || '';
result.id = defaultID;
return [result];
}
if (isArchivedRoom(report)) {
Expand Down

0 comments on commit 619394d

Please sign in to comment.