Make toNostrURI idempotent
This commit is contained in:
@@ -107,9 +107,7 @@ export class Nip46Receiver extends Emitter {
|
||||
await sleep(3000)
|
||||
}
|
||||
|
||||
if (response.id) {
|
||||
this.emit(Nip46Event.Receive, {...response, url, event} as Nip46Response)
|
||||
}
|
||||
this.emit(Nip46Event.Receive, {...response, url, event} as Nip46Response)
|
||||
})
|
||||
|
||||
this.sub!.emitter.on(SubscriptionEvent.Complete, () => {
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
export const fromNostrURI = (s: string) => s.replace(/^nostr:\/?\/?/, "")
|
||||
|
||||
export const toNostrURI = (s: string) => `nostr:${s}`
|
||||
export const toNostrURI = (s: string) => s.startsWith('nostr:') ? s : `nostr:${s}`
|
||||
|
||||
Reference in New Issue
Block a user