aboutsummaryrefslogtreecommitdiff
path: root/modern/src/SocketController.js
diff options
context:
space:
mode:
Diffstat (limited to 'modern/src/SocketController.js')
-rw-r--r--modern/src/SocketController.js6
1 files changed, 2 insertions, 4 deletions
diff --git a/modern/src/SocketController.js b/modern/src/SocketController.js
index 3d9748bd..73df6d0a 100644
--- a/modern/src/SocketController.js
+++ b/modern/src/SocketController.js
@@ -60,15 +60,13 @@ const SocketController = () => {
if (authenticated) {
const response = await fetch('/api/devices');
if (response.ok) {
- const devices = await response.json();
- dispatch(devicesActions.update(devices));
+ dispatch(devicesActions.refresh(await response.json()));
}
connectSocket();
} else {
const response = await fetch('/api/session');
if (response.ok) {
- const user = await response.json();
- dispatch(sessionActions.updateUser(user));
+ dispatch(sessionActions.updateUser(await response.json()));
} else {
history.push('/login');
}