From 9896fc039feb68975b0241cd8deb94f8b7f52251 Mon Sep 17 00:00:00 2001 From: danisharora099 Date: Wed, 30 Aug 2023 23:41:27 +0530 Subject: [PATCH] fix: listener binds --- packages/core/src/lib/base_protocol.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/packages/core/src/lib/base_protocol.ts b/packages/core/src/lib/base_protocol.ts index 3b306391d4..3126d081e4 100644 --- a/packages/core/src/lib/base_protocol.ts +++ b/packages/core/src/lib/base_protocol.ts @@ -22,7 +22,9 @@ export class BaseProtocol extends StreamManager implements IBaseProtocol { ) { super( multicodec, - components.connectionManager.getConnections.bind(components), + components.connectionManager.getConnections.bind( + components.connectionManager + ), log ); @@ -35,12 +37,12 @@ export class BaseProtocol extends StreamManager implements IBaseProtocol { this.addLibp2pEventListener( "peer:update", - super.handlePeerUpdateStreamPool + this.handlePeerUpdateStreamPool.bind(this) ); // TODO: might be better to check with `connection:close` event this.addLibp2pEventListener( "peer:disconnect", - super.handlePeerDisconnectStreamPool + this.handlePeerDisconnectStreamPool.bind(this) ); }