Skip to content
This repository was archived by the owner on Mar 27, 2025. It is now read-only.

Commit 55b8eb9

Browse files
committed
fix issue
1 parent ec9890a commit 55b8eb9

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

src/core/XAPI.ts

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,21 @@ class XAPI extends Listener {
2929
}
3030

3131
this.pingTimer = setInterval(() => {
32-
this.Socket.ping();
33-
this.Stream.ping();
32+
if (this.Socket.status) {
33+
this.Socket.ping();
34+
}
35+
if (this.Stream.status) {
36+
this.Stream.ping();
37+
}
3438
setTimeout(() => {
3539
if (this.Socket.status) {
3640
this.Socket.send.getServerTime();
3741
}
3842
}, 1000);
3943
setTimeout(() => {
40-
this.Socket.send.getTrades();
44+
if (this.Socket.status) {
45+
this.Socket.send.getTrades();
46+
}
4147
}, 2000);
4248
}, 19000);
4349
}, "constructor");

0 commit comments

Comments
 (0)