Skip to content

Commit

Permalink
Merge pull request #17817 from PrashantMangukiya/prashant-17770
Browse files Browse the repository at this point in the history
Trim leading and trailing space from email/phone input in new contact method page
  • Loading branch information
luacmartins authored Apr 25, 2023
2 parents 3bc9d8b + d02c96c commit 5e683b1
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/pages/settings/Profile/Contacts/NewContactMethodPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,12 +83,15 @@ class NewContactMethodPage extends Component {
}

submitForm() {
// Trim leading and trailing space from login
const login = this.state.login.trim();

// If this login already exists, just go back.
if (lodashGet(this.props.loginList, this.state.login)) {
if (lodashGet(this.props.loginList, login)) {
Navigation.navigate(ROUTES.SETTINGS_CONTACT_METHODS);
return;
}
User.addNewContactMethodAndNavigate(this.state.login, this.state.password);
User.addNewContactMethodAndNavigate(login, this.state.password);
}

render() {
Expand Down

0 comments on commit 5e683b1

Please sign in to comment.