Merge pull request #322 from PR0M3TH3AN/codex/fix-loading-errors-on-the-site

Handle alternate SimplePool exports
This commit is contained in:
thePR0M3TH3AN authored and GitHub committed 2025-10-06 10:43:58 -04:00
commit 332fc156bf
1 file changed
+8 -1
+8 -1
View File
@@ -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";