From 5ec948508588a5188129869b07914e895d34a6ae Mon Sep 17 00:00:00 2001 From: Jasper Huang Date: Tue, 25 Apr 2023 13:23:08 -0700 Subject: [PATCH 1/2] use value that is guaranteed to be defined --- src/libs/OptionsListUtils.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/libs/OptionsListUtils.js b/src/libs/OptionsListUtils.js index e5a5d22bec6e..666133149a88 100644 --- a/src/libs/OptionsListUtils.js +++ b/src/libs/OptionsListUtils.js @@ -437,8 +437,8 @@ function createOption(logins, personalDetails, report, reportActions = {}, { reportName = ReportUtils.getReportName(report, policies); } else { reportName = ReportUtils.getDisplayNameForParticipant(logins[0]); - result.keyForList = personalDetail.login; - result.alternateText = LocalePhoneNumber.formatPhoneNumber(personalDetail.login); + result.keyForList = logins[0]; + result.alternateText = LocalePhoneNumber.formatPhoneNumber(logins[0]); } result.isIOUReportOwner = ReportUtils.isIOUOwnedByCurrentUser(result, iouReports); From 3c2671a45abca866ca1070611055664d0b047d55 Mon Sep 17 00:00:00 2001 From: Jasper Huang Date: Tue, 25 Apr 2023 13:34:14 -0700 Subject: [PATCH 2/2] use variable --- src/libs/OptionsListUtils.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/libs/OptionsListUtils.js b/src/libs/OptionsListUtils.js index 666133149a88..e05c3613207d 100644 --- a/src/libs/OptionsListUtils.js +++ b/src/libs/OptionsListUtils.js @@ -436,9 +436,10 @@ function createOption(logins, personalDetails, report, reportActions = {}, { } reportName = ReportUtils.getReportName(report, policies); } else { - reportName = ReportUtils.getDisplayNameForParticipant(logins[0]); - result.keyForList = logins[0]; - result.alternateText = LocalePhoneNumber.formatPhoneNumber(logins[0]); + const login = logins[0]; + reportName = ReportUtils.getDisplayNameForParticipant(login); + result.keyForList = login; + result.alternateText = LocalePhoneNumber.formatPhoneNumber(login); } result.isIOUReportOwner = ReportUtils.isIOUOwnedByCurrentUser(result, iouReports);