Add back in error reporting

that I accidentally removed
This commit is contained in:
Eric Rosenbaum committed 2018-07-02 10:18:14 -04:00
1 parent 563571b396
commit 041c5dd245
1 file changed
+9 -1
+9 -1
View File
@@ -10,7 +10,8 @@ class ConnectionModal extends React.Component {
bindAll(this, [
'handleAbortConnecting',
'handleConnected',
'handleConnecting'
'handleConnecting',
'handleError'
]);
this.state = {
phase: 'scanning'
@@ -18,9 +19,11 @@ class ConnectionModal extends React.Component {
}
componentDidMount () {
this.props.vm.on('PERIPHERAL_CONNECTED', this.handleConnected);
this.props.vm.on('PERIPHERAL_ERROR', this.handleError);
}
componentWillUnmount () {
this.props.vm.removeListener('PERIPHERAL_CONNECTED', this.handleConnected);
this.props.vm.removeListener('PERIPHERAL_ERROR', this.handleError);
}
handleConnecting (peripheralId) {
this.props.vm.connectToPeripheral(this.props.extensionId, peripheralId);
@@ -28,6 +31,11 @@ class ConnectionModal extends React.Component {
phase: 'connecting'
});
}
handleError () {
this.setState({
phase: 'error'
});
}
handleAbortConnecting () {
// @todo: abort the current device connection process in the VM
this.setState({