aboutsummaryrefslogtreecommitdiff
path: root/modern/src/SocketContoller.js
diff options
context:
space:
mode:
Diffstat (limited to 'modern/src/SocketContoller.js')
-rw-r--r--modern/src/SocketContoller.js5
1 files changed, 4 insertions, 1 deletions
diff --git a/modern/src/SocketContoller.js b/modern/src/SocketContoller.js
index 3cf7feb..f65fc6c 100644
--- a/modern/src/SocketContoller.js
+++ b/modern/src/SocketContoller.js
@@ -1,6 +1,6 @@
import { Component } from 'react';
import { connect } from 'react-redux';
-import { updatePositions } from './actions';
+import { updateDevices, updatePositions } from './actions';
const displayNotifications = events => {
if ("Notification" in window) {
@@ -30,6 +30,9 @@ class SocketController extends Component {
socket.onmessage = (event) => {
const data = JSON.parse(event.data);
+ if (data.devices) {
+ this.props.dispatch(updateDevices(data.devices));
+ }
if (data.positions) {
this.props.dispatch(updatePositions(data.positions));
}