Skip to content

Commit

Permalink
fix: lint
Browse files Browse the repository at this point in the history
  • Loading branch information
daledah committed Feb 11, 2025
1 parent 83c8a52 commit 6104598
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions src/libs/PersonalDetailsUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ 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 {formatPhoneNumber} from './LocalePhoneNumber';
import {translateLocal} from './Localize';
import {areEmailsFromSamePrivateDomain} from './LoginUtils';
import * as UserUtils from './UserUtils';
import {generateAccountID} from './UserUtils';

type FirstAndLastName = {
firstName: string;
Expand Down Expand Up @@ -43,8 +43,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();
},
});

Expand Down Expand Up @@ -119,7 +119,7 @@ function getPersonalDetailsByIDs({
if (shouldChangeUserDisplayName && currentUserAccountID === detail.accountID) {
return {
...detail,
displayName: Localize.translateLocal('common.you'),
displayName: translateLocal('common.you'),
};
}

Expand All @@ -144,7 +144,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));
}
Expand Down Expand Up @@ -198,7 +198,7 @@ function getPersonalDetailsOnyxDataForOptimisticUsers(newLogins: string[], newAc
personalDetailsNew[accountID] = {
login,
accountID,
displayName: LocalePhoneNumber.formatPhoneNumber(login),
displayName: formatPhoneNumber(login),
isOptimisticPersonalDetail: true,
};

Expand Down Expand Up @@ -295,7 +295,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;
Expand All @@ -307,7 +307,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;
Expand Down

0 comments on commit 6104598

Please sign in to comment.