feat: improve the relays used for sending replies

This commit is contained in:
codytseng
2025-02-23 23:35:56 +08:00
parent e7cb7342aa
commit e6516d7acd
4 changed files with 48 additions and 14 deletions

View File

@@ -108,8 +108,9 @@ class ClientService extends EventTarget {
}
async publishEvent(relayUrls: string[], event: NEvent) {
const uniqueRelayUrls = Array.from(new Set(relayUrls))
const result = await Promise.any(
relayUrls.map(async (url) => {
uniqueRelayUrls.map(async (url) => {
// eslint-disable-next-line @typescript-eslint/no-this-alias
const that = this
const relay = await this.pool.ensureRelay(url)