-
Notifications
You must be signed in to change notification settings - Fork 3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
15 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,9 +7,9 @@ import type {OnyxInputOrEntry, PersonalDetails, PersonalDetailsList, PrivatePers | |
import type {Address} from '@src/types/onyx/PrivatePersonalDetails'; | ||
import type {OnyxData} from '@src/types/onyx/Request'; | ||
import {isEmptyObject} from '@src/types/utils/EmptyObject'; | ||
import * as LocalePhoneNumber from './LocalePhoneNumber'; | ||
import * as Localize from './Localize'; | ||
import * as UserUtils from './UserUtils'; | ||
import {formatPhoneNumber} from './LocalePhoneNumber'; | ||
import {translateLocal} from './Localize'; | ||
import {generateAccountID} from './UserUtils'; | ||
|
||
type FirstAndLastName = { | ||
firstName: string; | ||
|
@@ -42,8 +42,8 @@ Onyx.connect({ | |
if (!value) { | ||
return; | ||
} | ||
hiddenTranslation = Localize.translateLocal('common.hidden'); | ||
youTranslation = Localize.translateLocal('common.you').toLowerCase(); | ||
hiddenTranslation = translateLocal('common.hidden'); | ||
youTranslation = translateLocal('common.you').toLowerCase(); | ||
}, | ||
}); | ||
|
||
|
@@ -130,7 +130,7 @@ function getPersonalDetailsByIDs({ | |
if (shouldChangeUserDisplayName && currentUserAccountID === detail.accountID) { | ||
return { | ||
...detail, | ||
displayName: Localize.translateLocal('common.you'), | ||
displayName: translateLocal('common.you'), | ||
}; | ||
} | ||
|
||
|
@@ -155,7 +155,7 @@ function getAccountIDsByLogins(logins: string[]): number[] { | |
const currentDetail = personalDetails.find((detail) => detail?.login === login?.toLowerCase()); | ||
if (!currentDetail) { | ||
// generate an account ID because in this case the detail is probably new, so we don't have a real accountID yet | ||
foundAccountIDs.push(UserUtils.generateAccountID(login)); | ||
foundAccountIDs.push(generateAccountID(login)); | ||
} else { | ||
foundAccountIDs.push(Number(currentDetail.accountID)); | ||
} | ||
|
@@ -209,7 +209,7 @@ function getPersonalDetailsOnyxDataForOptimisticUsers(newLogins: string[], newAc | |
personalDetailsNew[accountID] = { | ||
login, | ||
accountID, | ||
displayName: LocalePhoneNumber.formatPhoneNumber(login), | ||
displayName: formatPhoneNumber(login), | ||
isOptimisticPersonalDetail: true, | ||
}; | ||
|
||
|
@@ -306,7 +306,7 @@ function getFormattedAddress(privatePersonalDetails: OnyxEntry<PrivatePersonalDe | |
*/ | ||
function getEffectiveDisplayName(personalDetail?: PersonalDetails): string | undefined { | ||
if (personalDetail) { | ||
return LocalePhoneNumber.formatPhoneNumber(personalDetail?.login ?? '') || personalDetail.displayName; | ||
return formatPhoneNumber(personalDetail?.login ?? '') || personalDetail.displayName; | ||
} | ||
|
||
return undefined; | ||
|
@@ -318,7 +318,7 @@ function getEffectiveDisplayName(personalDetail?: PersonalDetails): string | und | |
function createDisplayName(login: string, passedPersonalDetails: Pick<PersonalDetails, 'firstName' | 'lastName'> | OnyxInputOrEntry<PersonalDetails>): string { | ||
// If we have a number like [email protected] then let's remove @expensify.sms and format it | ||
// so that the option looks cleaner in our UI. | ||
const userLogin = LocalePhoneNumber.formatPhoneNumber(login); | ||
const userLogin = formatPhoneNumber(login); | ||
|
||
if (!passedPersonalDetails) { | ||
return userLogin; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters