diff --git a/src/pages/settings/Connection.tsx b/src/pages/settings/Connection.tsx index 58248326..7784f5b2 100644 --- a/src/pages/settings/Connection.tsx +++ b/src/pages/settings/Connection.tsx @@ -60,13 +60,13 @@ export const Connection = ({ }, }); - const connect = ( + const connect = async ( connectionType: connType, params: | HTTPConnectionParameters | SerialConnectionParameters | BLEConnectionParameters, - ): void => { + ): Promise => { connection.complete(); connection.disconnect(); @@ -201,10 +201,10 @@ export const Connection = ({
Previously connected devices
{bleDevices.map((device) => (
{ + onClick={async (): Promise => { console.log('clicked'); - connect(connType.BLE, { + await connect(connType.BLE, { device: device, }); }} @@ -213,10 +213,10 @@ export const Connection = ({ >
{device.name}
{ + onClick={async (): Promise => { console.log('clicked'); - connect(connType.BLE, { + await connect(connType.BLE, { device: device, }); }} @@ -254,8 +254,8 @@ export const Connection = ({ {device.getInfo().usbVendorId}
{ - connect(connType.SERIAL, { + onClick={async (): Promise => { + await connect(connType.SERIAL, { // @ts-ignore tmp device: device, });