1
0
mirror of https://github.com/lensapp/lens.git synced 2025-05-20 05:10:56 +00:00

Fix: closing terminal tab error (#4874)

This commit is contained in:
Alex Andreev 2022-02-16 17:05:25 +03:00 committed by GitHub
parent d656a9e289
commit a2ee3c4d5d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -65,7 +65,7 @@ export interface WebSocketEvents {
type Defaulted<Params, DefaultParams extends keyof Params> = Required<Pick<Params, DefaultParams>> & Omit<Params, DefaultParams>;
export class WebSocketApi<Events extends WebSocketEvents> extends (EventEmitter as { new<T>(): TypedEventEmitter<T> })<Events> {
protected socket: WebSocket;
protected socket?: WebSocket | null;
protected pendingCommands: (string | ArrayBufferLike | Blob | ArrayBufferView)[] = [];
protected reconnectTimer?: any;
protected pingTimer?: any;
@ -181,7 +181,7 @@ export class WebSocketApi<Events extends WebSocketEvents> extends (EventEmitter
if (error) {
const { reconnectDelay } = this.params;
if (reconnectDelay) {
if (reconnectDelay && this.socket) {
const url = this.socket.url;
this.writeLog("will reconnect in", `${reconnectDelay}s`);