diff options
Diffstat (limited to 'modern/src')
-rw-r--r-- | modern/src/SocketController.js | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/modern/src/SocketController.js b/modern/src/SocketController.js index 886ae15..ac95019 100644 --- a/modern/src/SocketController.js +++ b/modern/src/SocketController.js @@ -72,15 +72,15 @@ const SocketController = () => { if (socket) { socket.close(); } - } + }; + } + const response = await fetch('/api/session'); + if (response.ok) { + dispatch(sessionActions.updateUser(await response.json())); } else { - const response = await fetch('/api/session'); - if (response.ok) { - dispatch(sessionActions.updateUser(await response.json())); - } else { - history.push('/login'); - } + history.push('/login'); } + return null; }, [authenticated]); return null; |