Browse Source

Fix build

pull/2/head
Sacha Weatherstone 5 years ago
parent
commit
7001c9ab2f
  1. 16
      src/pages/settings/Connection.tsx

16
src/pages/settings/Connection.tsx

@ -60,13 +60,13 @@ export const Connection = ({
}, },
}); });
const connect = ( const connect = async (
connectionType: connType, connectionType: connType,
params: params:
| HTTPConnectionParameters | HTTPConnectionParameters
| SerialConnectionParameters | SerialConnectionParameters
| BLEConnectionParameters, | BLEConnectionParameters,
): void => { ): Promise<void> => {
connection.complete(); connection.complete();
connection.disconnect(); connection.disconnect();
@ -201,10 +201,10 @@ export const Connection = ({
<div>Previously connected devices</div> <div>Previously connected devices</div>
{bleDevices.map((device) => ( {bleDevices.map((device) => (
<div <div
onClick={() => { onClick={async (): Promise<void> => {
console.log('clicked'); console.log('clicked');
connect(connType.BLE, { await connect(connType.BLE, {
device: device, device: device,
}); });
}} }}
@ -213,10 +213,10 @@ export const Connection = ({
> >
<div className="my-auto">{device.name}</div> <div className="my-auto">{device.name}</div>
<IconButton <IconButton
onClick={() => { onClick={async (): Promise<void> => {
console.log('clicked'); console.log('clicked');
connect(connType.BLE, { await connect(connType.BLE, {
device: device, device: device,
}); });
}} }}
@ -254,8 +254,8 @@ export const Connection = ({
{device.getInfo().usbVendorId} {device.getInfo().usbVendorId}
</div> </div>
<IconButton <IconButton
onClick={() => { onClick={async (): Promise<void> => {
connect(connType.SERIAL, { await connect(connType.SERIAL, {
// @ts-ignore tmp // @ts-ignore tmp
device: device, device: device,
}); });

Loading…
Cancel
Save