diff --git a/src/containers/connection-modal.jsx b/src/containers/connection-modal.jsx index 82b4dbd5f2d8ce36670f2bb4f89c00889efb239f..8edf15e439381e6e49ddd0a3b6fe20c1ce3263d6 100644 --- a/src/containers/connection-modal.jsx +++ b/src/containers/connection-modal.jsx @@ -17,18 +17,13 @@ class ConnectionModal extends React.Component { 'handleHelp' ]); this.state = { - phase: PHASES.scanning + phase: props.vm.getPeripheralIsConnected(props.extensionId) ? + PHASES.connected : PHASES.scanning }; } componentDidMount () { this.props.vm.on('PERIPHERAL_CONNECTED', this.handleConnected); this.props.vm.on('PERIPHERAL_ERROR', this.handleError); - - // Check if we're already connected - if (this.props.vm.getPeripheralIsConnected(this.props.extensionId)) { - this.handleConnected(); - } - } componentWillUnmount () { this.props.vm.removeListener('PERIPHERAL_CONNECTED', this.handleConnected);