some small fixes.

This commit is contained in:
fiatjaf
2021-02-17 18:07:34 -03:00
parent 0e1c23a3f9
commit 87de1310b5
2 changed files with 4 additions and 9 deletions

View File

@@ -23,7 +23,7 @@ export function relayPool(globalPrivateKey) {
}
const sub = async (cb, params) => {
const subControllers = R.map(relay => {
const subControllers = R.map(({relay}) => {
return relay.sub(params, cb.bind(null, relay))
}, R.filter(R.pipe(R.prop('policy'), R.prop('write'), R.equals(true)), relays))
@@ -38,6 +38,7 @@ export function relayPool(globalPrivateKey) {
}
return {
sub,
relays,
setPrivateKey(privateKey) {
globalPrivateKey = privateKey
@@ -71,10 +72,6 @@ export function relayPool(globalPrivateKey) {
relay.close()
delete relays[relayURL]
},
offEvent(cb) {
let index = eventCallbacks.indexOf(cb)
if (index !== -1) eventCallbacks.splice(index, 1)
},
onNotice(cb) {
noticeCallbacks.push(cb)
},