Skip to content

Commit

Permalink
Add appropriate defaults
Browse files Browse the repository at this point in the history
  • Loading branch information
Beamanator committed Jun 20, 2023
1 parent cb4d866 commit badbbd0
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/libs/OptionsListUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -216,18 +216,19 @@ function isPersonalDetailsReady(personalDetails) {
function getParticipantsOptions(report, personalDetails) {
const participants = lodashGet(report, 'participantAccountIDs', []);
return _.map(getPersonalDetailsForAccountIDs(participants, personalDetails), (details) => ({
keyForList: details.login,
login: details.login,
keyForList: details.login || details.displayName || String(details.accountID),
login: details.login || details.displayName,
accountID: details.accountID,
text: details.displayName,
firstName: lodashGet(details, 'firstName', ''),
lastName: lodashGet(details, 'lastName', ''),
alternateText: Str.isSMSLogin(details.login || '') ? LocalePhoneNumber.formatPhoneNumber(details.login) : details.login,
alternateText: Str.isSMSLogin(details.login || '') ? LocalePhoneNumber.formatPhoneNumber(details.login) : details.login || details.displayName,
icons: [
{
source: UserUtils.getAvatar(details.avatar, details.accountID),
name: details.login,
type: CONST.ICON_TYPE_AVATAR,
id: details.accountID,
},
],
payPalMeAddress: lodashGet(details, 'payPalMeAddress', ''),
Expand Down Expand Up @@ -857,12 +858,13 @@ function getSearchOptions(reports, personalDetails, searchValue = '', betas) {
function getIOUConfirmationOptionsFromPayeePersonalDetail(personalDetail, amountText) {
return {
text: personalDetail.displayName ? personalDetail.displayName : personalDetail.login,
alternateText: personalDetail.login,
alternateText: personalDetail.login || personalDetail.displayName,
icons: [
{
source: UserUtils.getAvatar(personalDetail.avatar, personalDetail.accountID),
name: personalDetail.login,
type: CONST.ICON_TYPE_AVATAR,
id: personalDetail.accountID,
},
],
descriptiveText: amountText,
Expand Down

0 comments on commit badbbd0

Please sign in to comment.