Fix build
This commit is contained in:
@@ -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,
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user