diff --git a/android/app/build.gradle b/android/app/build.gradle index 7083912d3a78..ef5a3efb1c08 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -152,8 +152,8 @@ android { minSdkVersion rootProject.ext.minSdkVersion targetSdkVersion rootProject.ext.targetSdkVersion multiDexEnabled rootProject.ext.multiDexEnabled - versionCode 1001013701 - versionName "1.1.37-1" + versionCode 1001013702 + versionName "1.1.37-2" } splits { abi { diff --git a/ios/NewExpensify/Info.plist b/ios/NewExpensify/Info.plist index 508f7b6a7820..9be2768eaa62 100644 --- a/ios/NewExpensify/Info.plist +++ b/ios/NewExpensify/Info.plist @@ -31,7 +31,7 @@ CFBundleVersion - 1.1.37.1 + 1.1.37.2 ITSAppUsesNonExemptEncryption LSApplicationQueriesSchemes diff --git a/ios/NewExpensifyTests/Info.plist b/ios/NewExpensifyTests/Info.plist index 12f5e3c66620..0188d71d7cf4 100644 --- a/ios/NewExpensifyTests/Info.plist +++ b/ios/NewExpensifyTests/Info.plist @@ -19,6 +19,6 @@ CFBundleSignature ???? CFBundleVersion - 1.1.37.1 + 1.1.37.2 diff --git a/package-lock.json b/package-lock.json index ff2dab13db05..68c95a7c7c68 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "new.expensify", - "version": "1.1.37-1", + "version": "1.1.37-2", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 92ea9088c04c..0c2eb6b08fa9 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "new.expensify", - "version": "1.1.37-1", + "version": "1.1.37-2", "author": "Expensify, Inc.", "homepage": "https://new.expensify.com", "description": "New Expensify is the next generation of Expensify: a reimagination of payments based atop a foundation of chat.", diff --git a/src/CONST.js b/src/CONST.js index 1a86d93f7e2c..e2d301cc0c56 100755 --- a/src/CONST.js +++ b/src/CONST.js @@ -282,6 +282,7 @@ const CONST = { HOMEPAGE_REPORTS_LOADED: 'homepage_reports_loaded', SWITCH_REPORT: 'switch_report', SIDEBAR_LOADED: 'sidebar_loaded', + PERSONAL_DETAILS_FORMATTED: 'personal_details_formatted', COLD: 'cold', REPORT_ACTION_ITEM_LAYOUT_DEBOUNCE_TIME: 1500, TOOLTIP_SENSE: 1000, diff --git a/src/libs/actions/PersonalDetails.js b/src/libs/actions/PersonalDetails.js index 22453fcd4ee9..d21475511faa 100644 --- a/src/libs/actions/PersonalDetails.js +++ b/src/libs/actions/PersonalDetails.js @@ -12,6 +12,7 @@ import * as ReportUtils from '../reportUtils'; import * as OptionsListUtils from '../OptionsListUtils'; import Growl from '../Growl'; import * as Localize from '../Localize'; +import Timing from './Timing'; let currentUserEmail = ''; Onyx.connect({ @@ -82,32 +83,37 @@ function getMaxCharacterError(isError) { * @return {Object} */ function formatPersonalDetails(personalDetailsList) { - return _.reduce(personalDetailsList, (finalObject, personalDetailsResponse, login) => { + Timing.start(CONST.TIMING.PERSONAL_DETAILS_FORMATTED); + const formattedResult = {}; + + // This method needs to be SUPER PERFORMANT because it can be called with a massive list of logins depending on the policies that someone belongs to + // eslint-disable-next-line rulesdir/prefer-underscore-method + Object.keys(personalDetailsList).forEach((login) => { + const personalDetailsResponse = personalDetailsList[login]; + // Form the details into something that has all the data in an easy to use format. const avatar = getAvatar(personalDetailsResponse, login); const displayName = getDisplayName(login, personalDetailsResponse); - const pronouns = lodashGet(personalDetailsResponse, 'pronouns', ''); - const timezone = lodashGet(personalDetailsResponse, 'timeZone', CONST.DEFAULT_TIME_ZONE); - const firstName = lodashGet(personalDetailsResponse, 'firstName', ''); - const lastName = lodashGet(personalDetailsResponse, 'lastName', ''); - const payPalMeAddress = lodashGet(personalDetailsResponse, 'expensify_payPalMeAddress', ''); - const phoneNumber = lodashGet(personalDetailsResponse, 'phoneNumber', ''); - - return { - ...finalObject, - [login]: { - login, - avatar, - displayName, - firstName, - lastName, - pronouns, - timezone, - payPalMeAddress, - phoneNumber, - }, + const pronouns = personalDetailsResponse.pronouns || ''; + const timezone = personalDetailsResponse.timeZone || CONST.DEFAULT_TIME_ZONE; + const firstName = personalDetailsResponse.firstName || ''; + const lastName = personalDetailsResponse.lastName || ''; + const payPalMeAddress = personalDetailsResponse.expensify_payPalMeAddress || ''; + const phoneNumber = personalDetailsResponse.phoneNumber || ''; + formattedResult[login] = { + login, + avatar, + displayName, + firstName, + lastName, + pronouns, + timezone, + payPalMeAddress, + phoneNumber, }; - }, {}); + }); + Timing.end(CONST.TIMING.PERSONAL_DETAILS_FORMATTED); + return formattedResult; } /**