From 7bd01516f4c7e74b8e766a7ec3f5e5520b6d0caa Mon Sep 17 00:00:00 2001 From: Audric Ackermann Date: Thu, 30 Jan 2020 14:48:45 +1100 Subject: [PATCH] trim pubkey when user can enter one to remove whitespaces --- ts/components/session/LeftPaneContactSection.tsx | 2 +- ts/components/session/LeftPaneMessageSection.tsx | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/ts/components/session/LeftPaneContactSection.tsx b/ts/components/session/LeftPaneContactSection.tsx index ad84635b7..e78c14005 100644 --- a/ts/components/session/LeftPaneContactSection.tsx +++ b/ts/components/session/LeftPaneContactSection.tsx @@ -237,7 +237,7 @@ export class LeftPaneContactSection extends React.Component { } private handleOnAddContact() { - const sessionID = this.state.addContactRecipientID; + const sessionID = this.state.addContactRecipientID.trim(); const error = validateNumber(sessionID, window.i18n); if (error) { diff --git a/ts/components/session/LeftPaneMessageSection.tsx b/ts/components/session/LeftPaneMessageSection.tsx index 16bc9871c..0f7eba2ca 100644 --- a/ts/components/session/LeftPaneMessageSection.tsx +++ b/ts/components/session/LeftPaneMessageSection.tsx @@ -278,6 +278,7 @@ export class LeftPaneMessageSection extends React.Component { } let pubkey: string; pubkey = this.state.pubKeyPasted || this.props.searchTerm; + pubkey = pubkey.trim(); const error = validateNumber(pubkey); if (!error) {