1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-12-23 09:52:26 +01:00

Fixing hardware connect error display (#7519)

This commit is contained in:
ryanml 2019-11-22 18:54:59 -07:00 committed by Whymarrh Whitby
parent 6820a245b5
commit 878e0e3164

View File

@ -116,10 +116,11 @@ class ConnectHardwareForm extends Component {
} }
}) })
.catch(e => { .catch(e => {
if (e === 'Window blocked') { const errorMessage = e.message
if (errorMessage === 'Window blocked') {
this.setState({ browserSupported: false, error: null}) this.setState({ browserSupported: false, error: null})
} else if (e !== 'Window closed' && e !== 'Popup closed') { } else if (errorMessage !== 'Window closed' && errorMessage !== 'Popup closed') {
this.setState({ error: e.toString() }) this.setState({ error: errorMessage })
} }
}) })
} }
@ -134,7 +135,7 @@ class ConnectHardwareForm extends Component {
unlocked: false, unlocked: false,
}) })
}).catch(e => { }).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', name: 'Error connecting hardware wallet',
}, },
customVariables: { customVariables: {
error: e.toString(), error: e.message,
}, },
}) })
this.setState({ error: e.toString() }) this.setState({ error: e.message })
}) })
} }