mirror of
https://github.com/PR0M3TH3AN/bitvid.git
synced 2026-10-30 01:12:39 +00:00
Handle alternate SimplePool exports
This commit is contained in:
1 parent
c4cc89af29
commit
d35f396c2f
1 file changed
+8
-1
+8
-1
@@ -4292,7 +4292,14 @@ class NostrClient {
|
||||
}
|
||||
|
||||
const tools = await ensureNostrTools();
|
||||
const SimplePool = tools?.SimplePool;
|
||||
const SimplePool =
|
||||
typeof tools?.SimplePool === "function"
|
||||
? tools.SimplePool
|
||||
: typeof tools?.pool?.SimplePool === "function"
|
||||
? tools.pool.SimplePool
|
||||
: typeof tools?.SimplePool?.SimplePool === "function"
|
||||
? tools.SimplePool.SimplePool
|
||||
: null;
|
||||
if (typeof SimplePool !== "function") {
|
||||
const error = new Error("NostrTools SimplePool is unavailable.");
|
||||
error.code = "nostr-simplepool-unavailable";
|
||||
|
||||
Reference in new issue
Block a user