@ -12,10 +12,10 @@ export function useBadges(
|
||||
leaveOpen = true
|
||||
): { badges: Badge[]; awards: TaggedNostrEvent[] } {
|
||||
const rb = useMemo(() => {
|
||||
if (!pubkey) return null;
|
||||
const rb = new RequestBuilder(`badges:${pubkey.slice(0, 12)}`);
|
||||
rb.withOptions({ leaveOpen });
|
||||
rb.withFilter().authors([pubkey]).kinds([EventKind.Badge]);
|
||||
rb.withFilter().authors([pubkey]).kinds([EventKind.BadgeAward]).since(since);
|
||||
rb.withFilter().authors([pubkey]).kinds([EventKind.Badge, EventKind.BadgeAward]);
|
||||
return rb;
|
||||
}, [pubkey, since]);
|
||||
|
||||
|
@ -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,
|
||||
})
|
||||
|
Reference in New Issue
Block a user