This commit is contained in:
Aleksandr Kraiz
2022-06-06 15:04:37 +04:00
parent 11de694b6f
commit 85c0dde0ae

View File

@@ -107,6 +107,7 @@ export default class PriceFeedSubscription<T extends SubscriptionType = Subscrip
};
this.ws.onclose = (e) => {
if (this.heartbeatInterval) clearInterval(this.heartbeatInterval);
if (e.code !== 4000) this.init();
};
@@ -116,7 +117,6 @@ export default class PriceFeedSubscription<T extends SubscriptionType = Subscrip
}
kill() {
if (this.heartbeatInterval) clearInterval(this.heartbeatInterval);
this.ws?.close(4000);
}
}