diff options
Diffstat (limited to 'modern/src/SocketContoller.js')
-rw-r--r-- | modern/src/SocketContoller.js | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/modern/src/SocketContoller.js b/modern/src/SocketContoller.js index 3cf7feb7..f65fc6c1 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)); } |