diff --git a/app/providers/ProtocolProvider/protocol/protocol.ts b/app/providers/ProtocolProvider/protocol/protocol.ts index 4846b6c..fb3a4b8 100644 --- a/app/providers/ProtocolProvider/protocol/protocol.ts +++ b/app/providers/ProtocolProvider/protocol/protocol.ts @@ -65,10 +65,11 @@ export default class Protocol extends EventEmitter { } public startHeartbeat(intervalS : number) { + let _this = this; const heartbeat = () => { - if(this.socket && this.socket.readyState === WebSocket.OPEN){ + if(_this.socket && _this.socket.readyState === WebSocket.OPEN){ console.info("HEARTBEAT"); - this.socket?.send('heartbeat'); + _this.socket?.send('heartbeat'); } } if(this.heartbeatIntervalTimer){