mirror of
https://github.com/nostr-connect/connect.git
synced 2025-12-17 13:14:20 +01:00
fix author
This commit is contained in:
@@ -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;
|
||||||
|
|||||||
Reference in New Issue
Block a user