From 1bf13d977619bde2aae2e0c15edf2d1202b128db Mon Sep 17 00:00:00 2001 From: easrng Date: Fri, 18 Feb 2022 17:13:49 -0500 Subject: [PATCH] fix broken things --- frontend/lib/chat.mjs | 4 ++-- frontend/lib/reconnecting-web-socket.mjs | 7 +++---- frontend/lib/watch-session.mjs | 1 - 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/frontend/lib/chat.mjs b/frontend/lib/chat.mjs index a5a0323..500e71c 100644 --- a/frontend/lib/chat.mjs +++ b/frontend/lib/chat.mjs @@ -386,7 +386,7 @@ export const logEventToChat = async (event) => { event.colour, document.createTextNode("left") ); - for(let kissed in kisses) delete kisses[kissed][user] + for (let kissed in kisses) delete kisses[kissed][user]; break; } case "ChatMessage": { @@ -475,7 +475,7 @@ const beep = () => { let viewers = []; -export const updateViewerList = (viewers) => { +export const updateViewerList = (_viewers) => { viewers = _viewers; const listContainer = document.querySelector("#viewer-list"); diff --git a/frontend/lib/reconnecting-web-socket.mjs b/frontend/lib/reconnecting-web-socket.mjs index fcea08a..88b733c 100644 --- a/frontend/lib/reconnecting-web-socket.mjs +++ b/frontend/lib/reconnecting-web-socket.mjs @@ -11,7 +11,6 @@ export default class ReconnectingWebSocket { this._lastConnect = 0; this._socket = null; this._unsent = []; - this._connect(true); } _connect(first) { if (this._socket) @@ -26,9 +25,9 @@ export default class ReconnectingWebSocket { } this._socket.addEventListener("close", () => this._reconnect()); this._socket.addEventListener("error", () => this._reconnect()); - this._socket.addEventListener("message", ({ data }) => - this._eventTarget.dispatchEvent(new MessageEvent("message", { data })) - ); + this._socket.addEventListener("message", ({ data }) => { + this._eventTarget.dispatchEvent(new MessageEvent("message", { data })); + }); this._socket.addEventListener("open", (e) => { if (first) this._eventTarget.dispatchEvent(new Event("open")); if (this._reconnecting) diff --git a/frontend/lib/watch-session.mjs b/frontend/lib/watch-session.mjs index 3ec215e..eb2304a 100644 --- a/frontend/lib/watch-session.mjs +++ b/frontend/lib/watch-session.mjs @@ -71,7 +71,6 @@ const setupIncomingEvents = (video, socket) => { socket.addEventListener("message", async (messageEvent) => { try { const event = JSON.parse(messageEvent.data); - if (!event.reflected) { switch (event.op) { case "SetPlaying":