diff --git a/src/index.ts b/src/index.ts index 53b43f5..dcfcaa5 100644 --- a/src/index.ts +++ b/src/index.ts @@ -359,7 +359,7 @@ async function handleListenConnections(aq: ActiveQuery) { }; const hookClose = () => { - swarm.onceSelf("close", closeCb); + swarmEvent?.once("close", closeCb); }; if (swarm.activeRelay) {