Move debug message inside if statement so that it only triggers when we try to reconnect

This commit is contained in:
mabashian 2021-06-07 13:30:19 -04:00
parent f83343592b
commit 151f9e79ed

View File

@ -31,9 +31,9 @@ export default function useWebsocket(subscribeGroups) {
};
ws.current.onclose = e => {
// eslint-disable-next-line no-console
console.debug('Socket closed. Reconnecting...', e);
if (e.code !== 1000) {
// eslint-disable-next-line no-console
console.debug('Socket closed. Reconnecting...', e);
setTimeout(() => {
connect();
}, 1000);