fix: badges

closes #103
This commit is contained in:
2023-11-14 14:46:49 +00:00
parent c0ef9a5fc1
commit 0882425eea
4 changed files with 7 additions and 5 deletions

View File

@ -49,9 +49,10 @@ export function useUserCards(pubkey: string, userCards: Array<string[]>, leaveOp
return cards;
}
export function useCards(pubkey: string, leaveOpen = false): TaggedNostrEvent[] {
export function useCards(pubkey?: string, leaveOpen = false): TaggedNostrEvent[] {
const sub = useMemo(() => {
const b = new RequestBuilder(`user-cards:${pubkey.slice(0, 12)}`);
if (!pubkey) return null;
const b = new RequestBuilder(`user-cards:${pubkey?.slice(0, 12)}`);
b.withOptions({
leaveOpen,
})