From 97cabd592bf82af8e54653c989986e73e742b53f Mon Sep 17 00:00:00 2001 From: Liam <67254223+RealFascinated@users.noreply.github.com> Date: Fri, 14 Oct 2022 12:46:16 +0100 Subject: [PATCH] Now hides UI when socket connection is lost --- pages/overlay.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pages/overlay.js b/pages/overlay.js index d9cfb5c..0478978 100644 --- a/pages/overlay.js +++ b/pages/overlay.js @@ -161,6 +161,10 @@ export default class Overlay extends Component { socketAddress = (socketAddress === undefined ? 'ws://localhost' : `ws://${socketAddress}`) + ":6557/socket"; if (this.state.isConnectedToSocket) return; + if (this.state.isVisible) { + this.resetData(false); + } + console.log(`Connecting to ${socketAddress}`); const socket = new WebSocket(socketAddress); socket.addEventListener('open', () => {