-
Notifications
You must be signed in to change notification settings - Fork 2.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix IOU request sent to new phone number account #3651
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
3542e8a
Add util to add SMS domain to phone num login
Beamanator c0ba461
Remove SMS domain where necessary
Beamanator 250870a
Add sms domain while merging personal details for logins
Beamanator a107e9f
Reposition and fix up util function
Beamanator 0973d3a
Add SMS domain to user-to-invite's login
Beamanator File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 |
---|---|---|
|
@@ -25,6 +25,19 @@ let preferredLocale; | |
// will update when the OptionsListUtils re-loads. But will stay the same color for the life of the JS session. | ||
const defaultAvatarForUserToInvite = getDefaultAvatar(); | ||
|
||
/** | ||
* Adds expensify SMS domain (@expensify.sms) if login is a phone number and if it's not included yet | ||
* | ||
* @param {String} login | ||
* @return {String} | ||
*/ | ||
function addSMSDomainIfPhoneNumber(login) { | ||
if (Str.isValidPhone(login) && !Str.isValidEmail(login)) { | ||
return login + CONST.SMS.DOMAIN; | ||
} | ||
return login; | ||
} | ||
Comment on lines
+34
to
+39
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This could go nicely in expensify-common, but I wanted to keep this in one PR since it's a deploy blocker |
||
|
||
/** | ||
* Returns the personal details for an array of logins | ||
* | ||
|
@@ -38,7 +51,7 @@ function getPersonalDetailsForLogins(logins, personalDetails) { | |
|
||
if (!personalDetail) { | ||
personalDetail = { | ||
login, | ||
login: addSMSDomainIfPhoneNumber(login), | ||
displayName: login, | ||
avatar: getDefaultAvatar(login), | ||
}; | ||
|
@@ -339,7 +352,7 @@ function getOptions(reports, personalDetails, draftComments, activeReportID, { | |
&& (searchValue !== CONST.EMAIL.CHRONOS || Permissions.canUseChronos(betas)) | ||
) { | ||
// If the phone number doesn't have an international code then let's prefix it with the | ||
// current users international code based on their IP address. | ||
// current user's international code based on their IP address. | ||
const login = (Str.isValidPhone(searchValue) && !searchValue.includes('+')) | ||
? `+${countryCodeByIP}${searchValue}` | ||
: searchValue; | ||
|
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We might prefer to return early, but NAB
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or even make it a ternary, but I'm not sure either is more legible than this. I'd say let's keep it like it is now.