Skip to content
This repository was archived by the owner on May 13, 2024. It is now read-only.

Commit aea6075

Browse files
fix: address comments
1 parent c68807b commit aea6075

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/configs/websocket/index.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ export class ApiManager {
2424
private derivApi: TDerivApi;
2525
private pingInterval: NodeJS.Timer;
2626
private reconnectInterval: NodeJS.Timer;
27-
private websocket_connected: (connection_value) => boolean;
27+
private is_websocket_connected: (connection_value) => boolean;
2828
private is_websocket_authorized: (connection_value) => boolean;
2929

3030
public static instance: ApiManager;
@@ -57,8 +57,8 @@ export class ApiManager {
5757
}
5858

5959
public authorize(token: string, setIsConnected, setIsAuthorized) {
60-
this.websocket_connected = setIsConnected;
61-
this.websocket_authorize = setIsAuthorized;
60+
this.is_websocket_connected = setIsConnected;
61+
this.is_websocket_authorized = setIsAuthorized;
6262
return this.derivApi.authorize({ authorize: token });
6363
}
6464
public logout() {
@@ -73,15 +73,15 @@ export class ApiManager {
7373
clearInterval(this.reconnectInterval);
7474
}
7575
this.socket.addEventListener('open', () => {
76-
this.websocket_connected && this.websocket_connected(true);
76+
this.is_websocket_connected?.(true);
7777
this.pingInterval = setInterval(() => {
7878
this.socket.send(JSON.stringify({ ping: 1 }));
7979
}, PING_INTERVAL);
8080
});
8181

8282
this.socket.addEventListener('close', () => {
83-
this.websocket_connected && this.websocket_connected(false);
84-
this.websocket_authorize && this.websocket_authorize(false);
83+
this.is_websocket_connected?.(false);
84+
this.is_websocket_authorized?.(false);
8585
clearInterval(this.pingInterval);
8686
this.socket = null;
8787
if (attempts > 0) {

0 commit comments

Comments
 (0)