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:
parent
d656a9e289
commit
a2ee3c4d5d
@ -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`);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user