fix author

This commit is contained in:
tiero
2023-01-02 13:20:11 +01:00
parent c6a3be420c
commit 7c901b8c06

View File

@@ -67,14 +67,17 @@ export class NostrRPC {
return new Promise<void>((resolve, reject) => { return new Promise<void>((resolve, reject) => {
// waiting for response from remote // waiting for response from remote
// TODO: reject after a timeout const queries = [
let sub = this.relay.sub([
{ {
kinds: [4], kinds: [4],
authors: [this.target], authors: [target],
'#p': [this.self.pubkey], '#p': [this.self.pubkey],
}, },
]); ];
// TODO: reject after a timeout
let sub = this.relay.sub(queries);
console.log('subscribing to', JSON.stringify(queries));
sub.on('event', async (event: Event) => { sub.on('event', async (event: Event) => {
let payload; let payload;
@@ -92,8 +95,7 @@ export class NostrRPC {
// ignore all the events that are not NostrRPCResponse events // ignore all the events that are not NostrRPCResponse events
if (!isValidResponse(payload)) return; if (!isValidResponse(payload)) return;
console.log(`response: nostr id: ${event.id}`, payload);
console.log(`received response from nostr id: ${event.id}`, payload);
// ignore all the events that are not for this request // ignore all the events that are not for this request
if (payload.id !== id) return; if (payload.id !== id) return;