aboutsummaryrefslogtreecommitdiff
path: root/modern/src/SocketContoller.js
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2018-09-08 11:40:01 +1200
committerAnton Tananaev <anton.tananaev@gmail.com>2018-09-08 11:40:01 +1200
commit1461b376e41cf41cd9e49f6df200ba3f573fa127 (patch)
tree7d9aef29ef8f3b812ae75fe86d3b322185028500 /modern/src/SocketContoller.js
parent353bd397766bb5d780e8f0877f95aa0ad492b579 (diff)
downloadtrackermap-web-1461b376e41cf41cd9e49f6df200ba3f573fa127.tar.gz
trackermap-web-1461b376e41cf41cd9e49f6df200ba3f573fa127.tar.bz2
trackermap-web-1461b376e41cf41cd9e49f6df200ba3f573fa127.zip
Implement device list
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 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));
}