diff --git a/package.json b/package.json index bd91ae4e..3ec1709f 100644 --- a/package.json +++ b/package.json @@ -55,7 +55,7 @@ "eslint-import-resolver-typescript": "^2.5.0", "eslint-plugin-import": "^2.25.2", "eslint-plugin-react": "^7.26.1", - "eslint-plugin-react-hooks": "^4.2.0", + "eslint-plugin-react-hooks": "^4.2.1-alpha-9c8161ba8-20211028", "gzipper": "^6.0.0", "postcss": "^8.3.11", "prettier": "^2.4.1", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index b5498e72..8e05c773 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -28,7 +28,7 @@ specifiers: eslint-import-resolver-typescript: ^2.5.0 eslint-plugin-import: ^2.25.2 eslint-plugin-react: ^7.26.1 - eslint-plugin-react-hooks: ^4.2.0 + eslint-plugin-react-hooks: ^4.2.1-alpha-9c8161ba8-20211028 gzipper: ^6.0.0 i18next: ^21.3.3 i18next-browser-languagedetector: ^6.1.2 @@ -97,7 +97,7 @@ devDependencies: eslint-import-resolver-typescript: 2.5.0_f3fc3a8f1727ab01eb417b5ed5016c22 eslint-plugin-import: 2.25.2_eslint@8.1.0 eslint-plugin-react: 7.26.1_eslint@8.1.0 - eslint-plugin-react-hooks: 4.2.0_eslint@8.1.0 + eslint-plugin-react-hooks: 4.2.1-alpha-9c8161ba8-20211028_eslint@8.1.0 gzipper: 6.0.0 postcss: 8.3.11 prettier: 2.4.1 @@ -2240,11 +2240,11 @@ packages: eslint: 7.32.0 dev: true - /eslint-plugin-react-hooks/4.2.0_eslint@8.1.0: - resolution: {integrity: sha512-623WEiZJqxR7VdxFCKLI6d6LLpwJkGPYKODnkH3D7WpOG5KM8yWueBd8TLsNAetEJNF5iJmolaAKO3F8yzyVBQ==} + /eslint-plugin-react-hooks/4.2.1-alpha-9c8161ba8-20211028_eslint@8.1.0: + resolution: {integrity: sha512-wqdj1w8azrZwM5yYh3Pm6y/Cxg6nA+Nb2OqkHZ3Bf+cmnoCs2MSDUal+AnKAZN3kxWjSK4rljuromNaxUejyiA==} engines: {node: '>=10'} peerDependencies: - eslint: ^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0 || ^7.0.0 + eslint: ^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0-0 dependencies: eslint: 8.1.0 dev: true diff --git a/src/App.tsx b/src/App.tsx index f5f6ec79..be4fe835 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -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) => { diff --git a/src/pages/settings/Connection.tsx b/src/pages/settings/Connection.tsx index 22725631..58248326 100644 --- a/src/pages/settings/Connection.tsx +++ b/src/pages/settings/Connection.tsx @@ -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 => { @@ -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 = ({