From d2df6721bdcf53092e4470dfa923e923fc7d97f7 Mon Sep 17 00:00:00 2001 From: Siddharth Singh Date: Tue, 2 Jul 2024 05:01:16 +0530 Subject: [PATCH] fix kind 1 querying logic --- scripts/nostr-pull.ts | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/scripts/nostr-pull.ts b/scripts/nostr-pull.ts index ae5b0183..c3cbb67b 100644 --- a/scripts/nostr-pull.ts +++ b/scripts/nostr-pull.ts @@ -32,13 +32,14 @@ const importUsers = async ( await Promise.all(relays.map(async (relay) => { if (!relay.startsWith('wss://')) console.error(`Invalid relay url ${relay}`); const conn = new NRelay1(relay); - - const matched = [ - ...await conn.query([{ kinds: [0, 3], authors, limit: 1000 }]), - ...(!profilesOnly ? [] : await conn.query( - authors.map((author) => ({ kinds: [1], authors: [author], limit: 200 })), - )), - ]; + const matched = await conn.query([{ kinds: [0, 3], authors, limit: 1000 }]); + if (!profilesOnly) { + matched.push( + ...await conn.query( + authors.map((author) => ({ kinds: [1], authors: [author], limit: 200 })), + ), + ); + } await conn.close(); await Promise.all(