maybe fix a bug with calling sub.sub()

This commit is contained in:
fiatjaf
2022-06-04 18:34:54 -03:00
parent dc489bf387
commit faf8e62120
2 changed files with 4 additions and 5 deletions

View File

@@ -1,6 +1,6 @@
{
"name": "nostr-tools",
"version": "0.23.1",
"version": "0.23.3",
"description": "Tools for making a Nostr client.",
"repository": {
"type": "git",

View File

@@ -26,10 +26,9 @@ export function relayPool() {
const activeSubscriptions = {}
const sub = (
{cb, filter, beforeSend},
id = Math.random().toString().slice(2)
) => {
const sub = ({cb, filter, beforeSend}, id) => {
if (!id) id = Math.random().toString().slice(2)
const subControllers = Object.fromEntries(
Object.values(relays)
.filter(({policy}) => policy.read)