From 00daddce89f70989baecd8725e6df9bc88257b53 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Sun, 22 Mar 2020 17:32:36 -0700 Subject: Display features --- modern/src/SocketController.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'modern/src/SocketController.js') diff --git a/modern/src/SocketController.js b/modern/src/SocketController.js index f65fc6c1..b89845f2 100644 --- a/modern/src/SocketController.js +++ b/modern/src/SocketController.js @@ -43,7 +43,14 @@ class SocketController extends Component { } componentDidMount() { - this.connectSocket(); + fetch('/api/devices').then(response => { + if (response.ok) { + response.json().then(devices => { + this.props.dispatch(updateDevices(devices)); + }); + } + this.connectSocket(); + }); } render() { -- cgit v1.2.3