aboutsummaryrefslogtreecommitdiff
path: root/modern/src/SocketController.js
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2020-03-22 17:32:36 -0700
committerAnton Tananaev <anton.tananaev@gmail.com>2020-03-22 17:32:36 -0700
commit00daddce89f70989baecd8725e6df9bc88257b53 (patch)
treeabe4d199f269bb925831421fab17f5141f2640c3 /modern/src/SocketController.js
parent5e98816922c284805714e35a678f1a7dfa3facb8 (diff)
downloadtrackermap-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.js9
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() {