Skip to content

Commit

Permalink
ちょっと速くなったかも
Browse files Browse the repository at this point in the history
  • Loading branch information
nikolat committed May 7, 2023
1 parent 3cfb22b commit 25d7a36
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 16 deletions.
2 changes: 1 addition & 1 deletion docs/main.js

Large diffs are not rendered by default.

2 changes: 0 additions & 2 deletions docs/main.js.LICENSE.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */

/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */

/*! noble-secp256k1 - MIT License (c) 2019 Paul Miller (paulmillr.com) */
Expand Down
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
"watch": "webpack -w"
},
"devDependencies": {
"nostr-tools": "^1.8.2",
"nostr-tools": "^1.10.1",
"ts-loader": "^9.4.2",
"typescript": "^5.0.3",
"webpack": "^5.77.0",
"webpack-cli": "^5.0.1",
"typescript": "^5.0.4",
"webpack": "^5.82.0",
"webpack-cli": "^5.1.0",
"websocket-polyfill": "^0.0.3"
},
"type": "commonjs",
Expand Down
24 changes: 15 additions & 9 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,14 @@ declare var window: Window & typeof globalThis;
return;
}
gotF3 = true;
const relays: any = JSON.parse(eventF3.content);
let relays: any;
try {
relays = JSON.parse(eventF3.content);
} catch (error) {
console.log(error);
console.log(eventF3);
return;
}
const relaysa: string[] = [];
const followings: string[] = [];
eventF3.tags.forEach((tag: string[]) => {
Expand All @@ -413,15 +420,14 @@ declare var window: Window & typeof globalThis;
op.textContent = relay;
followingRelays.add(op);
});
await (async() => {
for (const relay of relaysa) {
try {
await pool.ensureRelay(relay);
} catch (error) {
console.log('ensureRelay error: ', error);
}
const procs = relaysa.map((relay) => {
try {
pool.ensureRelay(relay);
} catch (error) {
console.log('ensureRelay error: ', error);
}
})();
});
const ret = await Promise.all(procs);
const f0: Filter = {
kinds: [0],
authors: [pubkey],
Expand Down

0 comments on commit 25d7a36

Please sign in to comment.