Merge pull request 'nostr package: NIP-07' (#503) from nostr-package-window-nostr-object into main

Reviewed-on: #503
This commit is contained in:
2023-05-04 12:56:51 +00:00
12 changed files with 150 additions and 36 deletions

View File

@ -109,8 +109,8 @@ export default function LoginPage() {
}
async function doNip07Login() {
const relays = "getRelays" in window.nostr ? await window.nostr.getRelays() : undefined;
const pubKey = await window.nostr.getPublicKey();
const relays = "getRelays" in unwrap(window.nostr) ? await unwrap(window.nostr?.getRelays)() : undefined;
const pubKey = await unwrap(window.nostr).getPublicKey();
LoginStore.loginWithPubkey(pubKey, relays);
}