forked from Kieran/zap.stream
parent
c0ef9a5fc1
commit
0882425eea
@ -81,7 +81,7 @@ export function LiveChat({
|
|||||||
|
|
||||||
const reactions = useEventReactions(link, feed.reactions);
|
const reactions = useEventReactions(link, feed.reactions);
|
||||||
const events = useMemo(() => {
|
const events = useMemo(() => {
|
||||||
return [...feed.messages, ...feed.reactions, ...awards].sort((a, b) => b.created_at - a.created_at);
|
return [...feed.messages, ...feed.reactions, ...awards].filter(a => a.created_at > started).sort((a, b) => b.created_at - a.created_at);
|
||||||
}, [feed.messages, feed.reactions, awards]);
|
}, [feed.messages, feed.reactions, awards]);
|
||||||
|
|
||||||
const filteredEvents = useMemo(() => {
|
const filteredEvents = useMemo(() => {
|
||||||
|
@ -48,6 +48,7 @@
|
|||||||
gap: 16px;
|
gap: 16px;
|
||||||
flex: 1;
|
flex: 1;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
overflow-wrap: break-word;
|
||||||
}
|
}
|
||||||
|
|
||||||
.stream-card.image-card {
|
.stream-card.image-card {
|
||||||
|
@ -12,10 +12,10 @@ export function useBadges(
|
|||||||
leaveOpen = true
|
leaveOpen = true
|
||||||
): { badges: Badge[]; awards: TaggedNostrEvent[] } {
|
): { badges: Badge[]; awards: TaggedNostrEvent[] } {
|
||||||
const rb = useMemo(() => {
|
const rb = useMemo(() => {
|
||||||
|
if (!pubkey) return null;
|
||||||
const rb = new RequestBuilder(`badges:${pubkey.slice(0, 12)}`);
|
const rb = new RequestBuilder(`badges:${pubkey.slice(0, 12)}`);
|
||||||
rb.withOptions({ leaveOpen });
|
rb.withOptions({ leaveOpen });
|
||||||
rb.withFilter().authors([pubkey]).kinds([EventKind.Badge]);
|
rb.withFilter().authors([pubkey]).kinds([EventKind.Badge, EventKind.BadgeAward]);
|
||||||
rb.withFilter().authors([pubkey]).kinds([EventKind.BadgeAward]).since(since);
|
|
||||||
return rb;
|
return rb;
|
||||||
}, [pubkey, since]);
|
}, [pubkey, since]);
|
||||||
|
|
||||||
|
@ -49,9 +49,10 @@ export function useUserCards(pubkey: string, userCards: Array<string[]>, leaveOp
|
|||||||
return cards;
|
return cards;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function useCards(pubkey: string, leaveOpen = false): TaggedNostrEvent[] {
|
export function useCards(pubkey?: string, leaveOpen = false): TaggedNostrEvent[] {
|
||||||
const sub = useMemo(() => {
|
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({
|
b.withOptions({
|
||||||
leaveOpen,
|
leaveOpen,
|
||||||
})
|
})
|
||||||
|
Loading…
Reference in New Issue
Block a user