From c8ccb7afc48a292425d20827bc7013270636e8b1 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/reconnecting-web-socket.mjs | 7 +++---- frontend/lib/watch-session.mjs | 1 - 2 files changed, 3 insertions(+), 5 deletions(-) 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":