repositories
/
e-mobility-charging-stations-simulator.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
UI protocol: Allow to send some relevant commands to several charging… (#152)
[e-mobility-charging-stations-simulator.git]
/
src
/
ui
/
web
/
src
/
composable
/
UIClient.ts
diff --git
a/src/ui/web/src/composable/UIClient.ts
b/src/ui/web/src/composable/UIClient.ts
index eb8e013e371e8e958e654bf00b62b80846a00922..6803ef03de2674486a9941406573ce48d4a3a48a 100644
(file)
--- a/
src/ui/web/src/composable/UIClient.ts
+++ b/
src/ui/web/src/composable/UIClient.ts
@@
-112,8
+112,8
@@
export default class UIClient {
private responseHandler(messageEvent: MessageEvent<string>): void {
const data = JSON.parse(messageEvent.data) as ProtocolResponse;
private responseHandler(messageEvent: MessageEvent<string>): void {
const data = JSON.parse(messageEvent.data) as ProtocolResponse;
- if (
Utils.isIterable
(data) === false) {
- throw new Error('Response not
iterable
: ' + JSON.stringify(data, null, 2));
+ if (
Array.isArray
(data) === false) {
+ throw new Error('Response not
an array
: ' + JSON.stringify(data, null, 2));
}
const [uuid, response] = data;
}
const [uuid, response] = data;