Skip to content

Commit

Permalink
Fixing hardware connect error display (#7519)
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanml authored and Gudahtt committed Dec 5, 2019
1 parent 5798a9e commit e673bfb
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions ui/app/pages/create-account/connect-hardware/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 })
}
})
}
Expand All @@ -134,7 +135,7 @@ class ConnectHardwareForm extends Component {
unlocked: false,
})
}).catch(e => {
this.setState({ error: e.toString() })
this.setState({ error: e.message })
})
}

Expand Down Expand Up @@ -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 })
})
}

Expand Down

0 comments on commit e673bfb

Please sign in to comment.