refactor: upgrade kv client lib

This commit is contained in:
Ash Keel 2023-01-26 13:18:08 +01:00
parent 6f4bff373d
commit e0449ee972
No known key found for this signature in database
GPG Key ID: BAD8D93E7314ED3E
3 changed files with 10 additions and 22 deletions

View File

@ -8,7 +8,6 @@
"name": "strimertul-frontend",
"version": "1.0.0",
"dependencies": {
"@billjs/event-emitter": "^1.0.3",
"@fontsource/space-mono": "^4.5.10",
"@radix-ui/colors": "^0.1.8",
"@radix-ui/react-alert-dialog": "^1.0.2",
@ -25,7 +24,7 @@
"@redux-devtools/extension": "^3.2.3",
"@reduxjs/toolkit": "^1.9.0",
"@stitches/react": "^1.2.8",
"@strimertul/kilovolt-client": "^6.5.0",
"@strimertul/kilovolt-client": "^7.0.0",
"@types/node": "^18.11.9",
"@types/react": "^18.0.25",
"@types/react-dom": "^18.0.9",
@ -491,11 +490,6 @@
"node": ">=6.9.0"
}
},
"node_modules/@billjs/event-emitter": {
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/@billjs/event-emitter/-/event-emitter-1.0.3.tgz",
"integrity": "sha512-ZvzKYD/Gk9HSq42jCHFlTXb3oJztspH7WTdlVU6WdW3MKk6Jja/wWhxRSpT07aDkU69pqdUl9zx6lpG6/qxO6g=="
},
"node_modules/@cush/relative": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/@cush/relative/-/relative-1.0.0.tgz",
@ -1237,9 +1231,9 @@
}
},
"node_modules/@strimertul/kilovolt-client": {
"version": "6.5.0",
"resolved": "https://registry.npmjs.org/@strimertul/kilovolt-client/-/kilovolt-client-6.5.0.tgz",
"integrity": "sha512-FAuMgkIkBklGAsJ4xewiSHz7U51cImrmuGTduKXQy4QwwNqb/scU3fURts5oZQndskadvD7oHGsXdiZr9apuUw=="
"version": "7.0.0",
"resolved": "https://registry.npmjs.org/@strimertul/kilovolt-client/-/kilovolt-client-7.0.0.tgz",
"integrity": "sha512-SD3mfxAnZcMXMud8tGQKbvkrRQqtM6RrZ68vMyjmuMAnnKTa+xUu5GKDgrFGjoqsrS6YN64dhAofTjELHb/a+g=="
},
"node_modules/@types/hoist-non-react-statics": {
"version": "3.3.1",
@ -5496,11 +5490,6 @@
"to-fast-properties": "^2.0.0"
}
},
"@billjs/event-emitter": {
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/@billjs/event-emitter/-/event-emitter-1.0.3.tgz",
"integrity": "sha512-ZvzKYD/Gk9HSq42jCHFlTXb3oJztspH7WTdlVU6WdW3MKk6Jja/wWhxRSpT07aDkU69pqdUl9zx6lpG6/qxO6g=="
},
"@cush/relative": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/@cush/relative/-/relative-1.0.0.tgz",
@ -6050,9 +6039,9 @@
"requires": {}
},
"@strimertul/kilovolt-client": {
"version": "6.5.0",
"resolved": "https://registry.npmjs.org/@strimertul/kilovolt-client/-/kilovolt-client-6.5.0.tgz",
"integrity": "sha512-FAuMgkIkBklGAsJ4xewiSHz7U51cImrmuGTduKXQy4QwwNqb/scU3fURts5oZQndskadvD7oHGsXdiZr9apuUw=="
"version": "7.0.0",
"resolved": "https://registry.npmjs.org/@strimertul/kilovolt-client/-/kilovolt-client-7.0.0.tgz",
"integrity": "sha512-SD3mfxAnZcMXMud8tGQKbvkrRQqtM6RrZ68vMyjmuMAnnKTa+xUu5GKDgrFGjoqsrS6YN64dhAofTjELHb/a+g=="
},
"@types/hoist-non-react-statics": {
"version": "3.3.1",

View File

@ -3,7 +3,6 @@
"version": "1.0.0",
"type": "module",
"dependencies": {
"@billjs/event-emitter": "^1.0.3",
"@fontsource/space-mono": "^4.5.10",
"@radix-ui/colors": "^0.1.8",
"@radix-ui/react-alert-dialog": "^1.0.2",
@ -20,7 +19,7 @@
"@redux-devtools/extension": "^3.2.3",
"@reduxjs/toolkit": "^1.9.0",
"@stitches/react": "^1.2.8",
"@strimertul/kilovolt-client": "^6.5.0",
"@strimertul/kilovolt-client": "^7.0.0",
"@types/node": "^18.11.9",
"@types/react": "^18.0.25",
"@types/react-dom": "^18.0.9",

View File

@ -106,8 +106,8 @@ export const createWSClient = createAsyncThunk(
}
// Connect to websocket
const client = new KilovoltWS(options.address, options.password);
client.on('error', (err) => {
void dispatch(kvErrorReceived(err.data as kvError));
client.on('error', (err: CustomEvent<kvError>) => {
void dispatch(kvErrorReceived(err.detail));
});
await client.wait();
await dispatch(setupClientReconnect(client));