Skip to content
Snippets Groups Projects
Commit f4cd3513 authored by Evelyn Eastmond's avatar Evelyn Eastmond
Browse files

Beginning refactor: changing 'device' to 'peripheral', shortening some function names, etc.

parent 951ec667
No related branches found
No related tags found
No related merge requests found
......@@ -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
});
......
......@@ -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();
......
......@@ -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: []
......
......@@ -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;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment