diff --git a/src/lib/nostr.ts b/src/lib/nostr.ts index 96673b0..209a939 100644 --- a/src/lib/nostr.ts +++ b/src/lib/nostr.ts @@ -59,7 +59,9 @@ export async function getUserRelayList(nPubkey: string) { if (user.profile.relays && user.profile.relays.length > 0) { // assume kind:0 // the reason of string[]: https://github.com/nostr-dev-kit/ndk/blob/07dfd1a8b61acbbb93998fd591fd751760f99494/ndk/src/user/index.ts#L129 - return user.profile.relays as unknown as string[]; + if (!(typeof user.profile.relays === 'string')) { + return user.profile.relays as unknown as string[]; + } } if (user.profile.nip05) { const nip05 = await NDKUser.fromNip05(user.profile.nip05); diff --git a/src/lib/stores/l402.ts b/src/lib/stores/l402.ts index 7d5d144..38200c7 100644 --- a/src/lib/stores/l402.ts +++ b/src/lib/stores/l402.ts @@ -28,7 +28,8 @@ export const authInProcess = { return ''; } const vals: AuthInProcess[] = JSON.parse(data); - return vals.find((val) => (val.slug = slug))?.macaroon; + const found = vals.find((val) => val.slug === slug); + return found ? found.macaroon : ''; }, set: (newval: AuthInProcess) => { if (!browser) {