now it works.

This commit is contained in:
fiatjaf
2021-01-10 00:03:33 -03:00
parent 65e6f22a00
commit 13dcdf39e3
5 changed files with 11 additions and 11 deletions

View File

@@ -8,10 +8,10 @@ export function relayPool(globalPrivateKey) {
const eventCallbacks = []
const noticeCallbacks = []
function propagateEvent(context, event, relayURL) {
function propagateEvent(event, context, relayURL) {
for (let i = 0; i < eventCallbacks.length; i++) {
let {relay} = relays[relayURL]
eventCallbacks[i](context, event, relay)
eventCallbacks[i](event, context, relay)
}
}
function propagateNotice(notice, relayURL) {
@@ -33,7 +33,7 @@ export function relayPool(globalPrivateKey) {
if (policyFilter.write && policy.write) {
await fn(relay)
} else if (policyFilter.read && policy.read) {
await fn(relays)
await fn(relay)
}
}
}