diff options
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() { |