Skip to content
This repository has been archived by the owner on Sep 26, 2024. It is now read-only.

Commit

Permalink
fix: remove console logs
Browse files Browse the repository at this point in the history
  • Loading branch information
mayuran-deriv committed Feb 29, 2024
1 parent 45e7b64 commit 7c0efee
Showing 1 changed file with 0 additions and 5 deletions.
5 changes: 0 additions & 5 deletions src/common/websocket/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ export class ApiManager {
public init(lang?: string) {
if (!this.ready) {
if (!this.socket) {
console.log('WS connecting...')
const language = lang === 'ach' ? getCrowdin() : lang?.replace('-', '_')
const socket_url = getSocketURL()
const app_id = getAppId()
Expand All @@ -52,12 +51,10 @@ export class ApiManager {
}
this.derivApi = new DerivAPIBasic({ connection: this.socket })
this.socket.addEventListener('open', () => {
console.log('WS connected.')
this.setReadyState(this?.socket?.readyState)
})

this.socket.addEventListener('close', () => {
console.log('WS closed')
this.derivApi.disconnect()
this.ready = null
this.setReadyState(null)
Expand All @@ -67,14 +64,12 @@ export class ApiManager {
}

public reconnectIfNotConnected(lang?: string): Promise<void> {
console.log('WS reconnecting....')
return new Promise((resolve, reject) => {
if (this?.socket?.readyState !== 1) {
this.socket = null
this.ready = null
this.init(lang)
this?.socket?.addEventListener?.('open', () => {
console.log('WS connected using reconnect method.')
resolve()
})
} else {
Expand Down

0 comments on commit 7c0efee

Please sign in to comment.