Skip to content

Commit

Permalink
Allow TtyPlayer.stop to be called while still connecting (#48448)
Browse files Browse the repository at this point in the history
  • Loading branch information
bl-nero authored Nov 13, 2024
1 parent 771d085 commit 755a228
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions web/packages/teleport/src/lib/term/ttyPlayer.js
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,10 @@ export default class TtyPlayer extends Tty {
this.cancelTimeUpdate();
this._setPlayerStatus(StatusEnum.PAUSED);

if (this.webSocket.readyState !== WebSocket.OPEN) {
return;
}

const buffer = new ArrayBuffer(4);
const dv = new DataView(buffer);
dv.setUint8(0, messageTypePlayPause);
Expand Down

0 comments on commit 755a228

Please sign in to comment.