diff --git a/client/src/components/StreamPreview.tsx b/client/src/components/StreamPreview.tsx index e35da6b..45421da 100644 --- a/client/src/components/StreamPreview.tsx +++ b/client/src/components/StreamPreview.tsx @@ -66,7 +66,7 @@ const StreamPreview: FC = ({ title, wsUrl, streamerID, nViewers, startedT Data: "", }); setTimeout(() => { - ws.send(payload); + utils.sendWhenConnected(ws, payload); }, 100); }) diff --git a/client/src/components/Terminal.tsx b/client/src/components/Terminal.tsx index b23ad6e..b323e11 100644 --- a/client/src/components/Terminal.tsx +++ b/client/src/components/Terminal.tsx @@ -6,7 +6,6 @@ import * as message from "../types/message"; import * as buffer from "../lib/buffer"; import * as pako from "pako"; - interface Winsize { Rows: number; Cols: number; @@ -21,7 +20,6 @@ interface Props { className?: string; } - const Terminal: React.FC = ({ msgManager, width = -1, height = -1, delay = 0, className = ""}: Props) => { const termRef = useRef(null); const divRef = useRef(null); @@ -101,6 +99,7 @@ const Terminal: React.FC = ({ msgManager, width = -1, height = -1, delay return (
+
void; - winsizeCB: (ws:Winsize) => void - delay: number; // in milliseconds + winsizeCB: (ws:Winsize) => void; + delay: number; // in milliseconds constructor(writeCB: (arr: Uint8Array) => void, winsizeCB: (ws: Winsize) => void, delay: number = 0) { this.writeCB = writeCB; @@ -212,7 +211,7 @@ class WriteManager { let msgArrayString: string[] = JSON.parse(buffer.ab2str(data)); let msgArray: message.Wrapper[] = []; - msgArrayString.forEach((msgString: string, i) => { + msgArrayString.forEach((msgString: string) => { // re-compute the offset of this message with respect to the render time let msg: message.Wrapper = JSON.parse(window.atob(msgString)); msg.Delay = msg.Delay - blockDelayTime; diff --git a/client/src/pages/[room]/index.tsx b/client/src/pages/[room]/index.tsx index f44bf45..7f75365 100644 --- a/client/src/pages/[room]/index.tsx +++ b/client/src/pages/[room]/index.tsx @@ -302,18 +302,18 @@ class Room extends React.Component {
this.flashTitle()}> {this.state.roomInfo?.Status == RoomStatus.Streaming && -
+
-
+

{this.state.roomInfo!.Title}

@{this.state.roomInfo!.StreamerID}

-
+
-
+

{this.state.roomInfo!.NViewers}