From 1461b376e41cf41cd9e49f6df200ba3f573fa127 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Sat, 8 Sep 2018 11:40:01 +1200 Subject: Implement device list --- modern/src/SocketContoller.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'modern/src/SocketContoller.js') 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)); } -- cgit v1.2.3