Fix lint errors

This commit is contained in:
Sacha Weatherstone
2021-10-31 19:52:01 +11:00
parent a5d67279de
commit f630dc3141
4 changed files with 21 additions and 23 deletions
+6 -4
View File
@@ -90,8 +90,9 @@ const App = (): JSX.Element => {
);
});
connection.onNodeInfoPacket.subscribe((nodeInfoPacket) =>
dispatch(addNode(nodeInfoPacket.data)),
connection.onNodeInfoPacket.subscribe(
(nodeInfoPacket): void | { payload: Protobuf.NodeInfo; type: string } =>
dispatch(addNode(nodeInfoPacket.data)),
);
connection.onAdminPacket.subscribe((adminPacket) => {
@@ -111,8 +112,9 @@ const App = (): JSX.Element => {
}
});
connection.onMeshHeartbeat.subscribe((date) =>
dispatch(setLastMeshInterraction(date.getTime())),
connection.onMeshHeartbeat.subscribe(
(date): void | { payload: number; type: string } =>
dispatch(setLastMeshInterraction(date.getTime())),
);
connection.onTextPacket.subscribe((message) => {
+9 -13
View File
@@ -78,12 +78,8 @@ export const Connection = ({
setConnection(new ISerialConnection());
}
console.log(params);
// @ts-ignore
connection.connect(params);
console.log(connection);
// @ts-ignore tmp
await connection.connect(params);
};
const updateBleDeviceList = async (): Promise<void> => {
@@ -100,10 +96,10 @@ export const Connection = ({
React.useEffect(() => {
if (selectedConnType === connType.BLE) {
updateBleDeviceList();
void updateBleDeviceList();
}
if (selectedConnType === connType.SERIAL) {
updateSerialDeviceList();
void updateSerialDeviceList();
}
}, [selectedConnType]);
@@ -194,8 +190,8 @@ export const Connection = ({
</Button>
<Button
border
onClick={() => {
ble.getDevice();
onClick={async () => {
await ble.getDevice();
}}
>
New Device
@@ -239,8 +235,8 @@ export const Connection = ({
</Button>
<Button
border
onClick={() => {
serial.getPort();
onClick={async () => {
await serial.getPort();
}}
>
New Device
@@ -260,7 +256,7 @@ export const Connection = ({
<IconButton
onClick={() => {
connect(connType.SERIAL, {
// @ts-ignore
// @ts-ignore tmp
device: device,
});
}}