@@ -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