Fix: Check if valid data was received from websocket before assigning it
Otherwise it can lead to exceptions in inverterData method
This commit is contained in:
parent
b34b22c658
commit
9dec05def8
@ -485,7 +485,9 @@ export default defineComponent({
|
|||||||
|
|
||||||
this.socket.onmessage = (event) => {
|
this.socket.onmessage = (event) => {
|
||||||
console.log(event);
|
console.log(event);
|
||||||
|
if (event.data != "{}") {
|
||||||
this.liveData = JSON.parse(event.data);
|
this.liveData = JSON.parse(event.data);
|
||||||
|
}
|
||||||
this.dataLoading = false;
|
this.dataLoading = false;
|
||||||
this.heartCheck(); // Reset heartbeat detection
|
this.heartCheck(); // Reset heartbeat detection
|
||||||
};
|
};
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user