bug: NIP-7 race condition

bug: profile change spam
This commit is contained in:
2023-04-18 11:20:36 +01:00
parent 4f1e5df1a8
commit bffc8350e9
2 changed files with 16 additions and 11 deletions

View File

@ -70,7 +70,6 @@ export type EventBuilderHook = (ev: EventBuilder) => EventBuilder;
export class EventPublisher {
#pubKey: string;
#privateKey?: string;
#hasNip07 = "nostr" in window;
constructor(pubKey: string, privKey?: string) {
if (privKey) {
@ -81,6 +80,10 @@ export class EventPublisher {
}
}
get #hasNip07() {
return "nostr" in window;
}
#eb(k: EventKind) {
const eb = new EventBuilder();
return eb.pubKey(this.#pubKey).kind(k);