diff --git a/src/containers/auto-scanning-step.jsx b/src/containers/auto-scanning-step.jsx index f8c0360a331dd2e141bef116dc3376c67406796c..e5cdf457d169e93faff87498e92ed72ce33a084e 100644 --- a/src/containers/auto-scanning-step.jsx +++ b/src/containers/auto-scanning-step.jsx @@ -58,7 +58,7 @@ class AutoScanningStep extends React.Component { } handleStartScan () { this.bindPeripheralUpdates(); - this.props.vm.startDeviceScan(this.props.extensionId); + this.props.vm.scan(this.props.extensionId); this.setState({ phase: PHASES.pressbutton }); diff --git a/src/containers/connection-modal.jsx b/src/containers/connection-modal.jsx index 276d4f72a886e6df3b5f150d1cdd443e5eee9956..9471ccc960044b8ed9aa35dc6f728d7f46f4b0e8 100644 --- a/src/containers/connection-modal.jsx +++ b/src/containers/connection-modal.jsx @@ -17,7 +17,7 @@ class ConnectionModal extends React.Component { 'handleHelp' ]); this.state = { - phase: props.vm.getPeripheralIsConnected(props.extensionId) ? + phase: props.vm.isConnected(props.extensionId) ? PHASES.connected : PHASES.scanning }; } @@ -52,7 +52,7 @@ class ConnectionModal extends React.Component { } handleCancel () { // If we're not connected to a device, close the websocket so we stop scanning. - if (!this.props.vm.getPeripheralIsConnected(this.props.extensionId)) { + if (!this.props.vm.isConnected(this.props.extensionId)) { this.props.vm.disconnectExtensionSession(this.props.extensionId); } this.props.onCancel(); diff --git a/src/containers/scanning-step.jsx b/src/containers/scanning-step.jsx index 07595d5266d937c577f2e44634995b7849e3e5fb..f83a7d3f2c769ec81acaf38f080c24d4994ae867 100644 --- a/src/containers/scanning-step.jsx +++ b/src/containers/scanning-step.jsx @@ -18,7 +18,7 @@ class ScanningStep extends React.Component { }; } componentDidMount () { - this.props.vm.startDeviceScan(this.props.extensionId); + this.props.vm.scan(this.props.extensionId); this.props.vm.on( 'PERIPHERAL_LIST_UPDATE', this.handlePeripheralListUpdate); this.props.vm.on( @@ -45,7 +45,7 @@ class ScanningStep extends React.Component { this.setState({deviceList: peripheralArray}); } handleRefresh () { - this.props.vm.startDeviceScan(this.props.extensionId); + this.props.vm.scan(this.props.extensionId); this.setState({ scanning: true, deviceList: [] diff --git a/src/lib/blocks.js b/src/lib/blocks.js index f6b78b68ee4a325c5d03701e8d484466ba856f0c..5896760ea6fb8fd62e88a4e34dca85c4d36c600e 100644 --- a/src/lib/blocks.js +++ b/src/lib/blocks.js @@ -209,7 +209,7 @@ export default function (vm) { }; ScratchBlocks.FlyoutExtensionCategoryHeader.getExtensionState = function (extensionId) { - if (vm.getPeripheralIsConnected(extensionId)) { + if (vm.isConnected(extensionId)) { return ScratchBlocks.StatusButtonState.READY; } return ScratchBlocks.StatusButtonState.NOT_READY;