trim pubkey when user can enter one to remove whitespaces (#767)

trim pubkey when user can enter one to remove whitespaces
pull/768/head
Audric Ackermann 5 years ago committed by GitHub
commit 7ca3423529
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -237,7 +237,7 @@ export class LeftPaneContactSection extends React.Component<Props, State> {
} }
private handleOnAddContact() { private handleOnAddContact() {
const sessionID = this.state.addContactRecipientID; const sessionID = this.state.addContactRecipientID.trim();
const error = validateNumber(sessionID, window.i18n); const error = validateNumber(sessionID, window.i18n);
if (error) { if (error) {

@ -278,6 +278,7 @@ export class LeftPaneMessageSection extends React.Component<Props, any> {
} }
let pubkey: string; let pubkey: string;
pubkey = this.state.pubKeyPasted || this.props.searchTerm; pubkey = this.state.pubKeyPasted || this.props.searchTerm;
pubkey = pubkey.trim();
const error = validateNumber(pubkey); const error = validateNumber(pubkey);
if (!error) { if (!error) {

Loading…
Cancel
Save