From b20e90fc60962ed7cf677fe3876c0f9c85b5696e Mon Sep 17 00:00:00 2001 From: choelzl Date: Sun, 6 Feb 2022 19:18:26 +0100 Subject: [PATCH] WIP --- web/overlay/index.js | 25 +++---------------------- 1 file changed, 3 insertions(+), 22 deletions(-) diff --git a/web/overlay/index.js b/web/overlay/index.js index a94e3b1..87c7158 100644 --- a/web/overlay/index.js +++ b/web/overlay/index.js @@ -1,17 +1,6 @@ $(function () { - var webSocket = getWebSocket(), - queryMap = getQueryMap(), - isDebug = localStorage.getItem('phantombot_overlay_debug') === 'true' || false; - queue = []; - - const getWebSocket = () => { - let socketUri = ((window.location.protocol === 'https:' ? 'wss://' : 'ws://') + window.location.host + '/ws/overlay'), // URI of the socket. - reconnectInterval = 5000; // How often in milliseconds we should try reconnecting. - - return new ReconnectingWebSocket(socketUri, null, { - reconnectInterval: reconnectInterval - }); - } + const webSocket = window.socket, + queryMap = getQueryMap(), const getQueryMap = () => { let queryString = window.location.search, @@ -26,14 +15,6 @@ $(function () { return queryMap; } - const printDebug = (message, force) => { - if (isDebug || force) console.log('%c[PhantomBot Log]', 'color: #6441a5; font-weight: 900;', message); - } - window.toggleDebug = (toggle) => { - localStorage.setItem('phantombot_overlay_debug', toggle.toString()); - window.location.reload(); - } - const getOrElse = (option, def) => queryMap.has(option) ? queryMap.get(option): def; const handleSocketMessage = (e)=>{ @@ -54,7 +35,7 @@ $(function () { } else if(message['eventType'] == 'timer') { console.log("New timer !! ", message['data']) } - + } catch (ex) { console.log(ex) }