diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2020-03-22 17:32:36 -0700 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2020-03-22 17:32:36 -0700 |
commit | 00daddce89f70989baecd8725e6df9bc88257b53 (patch) | |
tree | abe4d199f269bb925831421fab17f5141f2640c3 /modern/src/SocketController.js | |
parent | 5e98816922c284805714e35a678f1a7dfa3facb8 (diff) | |
download | trackermap-web-00daddce89f70989baecd8725e6df9bc88257b53.tar.gz trackermap-web-00daddce89f70989baecd8725e6df9bc88257b53.tar.bz2 trackermap-web-00daddce89f70989baecd8725e6df9bc88257b53.zip |
Display features
Diffstat (limited to 'modern/src/SocketController.js')
-rw-r--r-- | modern/src/SocketController.js | 9 |
1 files changed, 8 insertions, 1 deletions
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() { |