From 878e0e3164fd0a2c60febc4a2c1a2e9d62fb9f24 Mon Sep 17 00:00:00 2001 From: ryanml Date: Fri, 22 Nov 2019 18:54:59 -0700 Subject: [PATCH] Fixing hardware connect error display (#7519) --- .../pages/create-account/connect-hardware/index.js | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/ui/app/pages/create-account/connect-hardware/index.js b/ui/app/pages/create-account/connect-hardware/index.js index 66851c780..ff8506142 100644 --- a/ui/app/pages/create-account/connect-hardware/index.js +++ b/ui/app/pages/create-account/connect-hardware/index.js @@ -116,10 +116,11 @@ class ConnectHardwareForm extends Component { } }) .catch(e => { - if (e === 'Window blocked') { + const errorMessage = e.message + if (errorMessage === 'Window blocked') { this.setState({ browserSupported: false, error: null}) - } else if (e !== 'Window closed' && e !== 'Popup closed') { - this.setState({ error: e.toString() }) + } else if (errorMessage !== 'Window closed' && errorMessage !== 'Popup closed') { + this.setState({ error: errorMessage }) } }) } @@ -134,7 +135,7 @@ class ConnectHardwareForm extends Component { unlocked: false, }) }).catch(e => { - this.setState({ error: e.toString() }) + this.setState({ error: e.message }) }) } @@ -162,10 +163,10 @@ class ConnectHardwareForm extends Component { name: 'Error connecting hardware wallet', }, customVariables: { - error: e.toString(), + error: e.message, }, }) - this.setState({ error: e.toString() }) + this.setState({ error: e.message }) }) }