From ec86ccfec276ce5d22acc1191eb9db34bf11beef Mon Sep 17 00:00:00 2001 From: Christopher Pappas Date: Wed, 10 Nov 2021 13:48:02 -0800 Subject: [PATCH] feat(websockets): Add ability to reconnect --- src/client/apps/websocket/client.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/client/apps/websocket/client.js b/src/client/apps/websocket/client.js index f2942b8bc..0fbaef37e 100644 --- a/src/client/apps/websocket/client.js +++ b/src/client/apps/websocket/client.js @@ -4,7 +4,10 @@ import { messageTypes } from "./messageTypes" let socket const init = (store, rootURL) => { - socket = io(rootURL) + socket = io(rootURL, { + reconnection: true, + }) + // add listeners to socket messages so we can re-dispatch them as actions Object.keys(messageTypes).forEach(key => socket.on(key, data => {