fix: get profile zaps in live feed
This commit is contained in:
@ -65,7 +65,8 @@ export function LiveChat({
|
|||||||
options?: LiveChatOptions;
|
options?: LiveChatOptions;
|
||||||
height?: number;
|
height?: number;
|
||||||
}) {
|
}) {
|
||||||
const feed = useLiveChatFeed(link);
|
const host = getHost(ev);
|
||||||
|
const feed = useLiveChatFeed(link, host);
|
||||||
const login = useLogin();
|
const login = useLogin();
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const pubkeys = [
|
const pubkeys = [
|
||||||
|
@ -9,22 +9,20 @@ import { System } from "index";
|
|||||||
import { useMemo } from "react";
|
import { useMemo } from "react";
|
||||||
import { LIVE_STREAM_CHAT } from "const";
|
import { LIVE_STREAM_CHAT } from "const";
|
||||||
|
|
||||||
export function useLiveChatFeed(link: NostrLink) {
|
export function useLiveChatFeed(link: NostrLink, host?: string) {
|
||||||
const sub = useMemo(() => {
|
const sub = useMemo(() => {
|
||||||
const rb = new RequestBuilder(`live:${link.id}:${link.author}`);
|
const rb = new RequestBuilder(`live:${link.id}:${link.author}`);
|
||||||
rb.withOptions({
|
rb.withOptions({
|
||||||
leaveOpen: true,
|
leaveOpen: true,
|
||||||
});
|
});
|
||||||
const aTag = `${link.kind}:${link.author}:${link.id}`;
|
const aTag = `${link.kind}:${link.author}:${link.id}`;
|
||||||
rb.withFilter()
|
rb.withFilter().kinds([LIVE_STREAM_CHAT]).tag("a", [aTag]).limit(100);
|
||||||
.kinds([LIVE_STREAM_CHAT])
|
rb.withFilter().kinds([EventKind.ZapReceipt]).tag("a", [aTag]);
|
||||||
.tag("a", [aTag])
|
if (host) {
|
||||||
.limit(100);
|
rb.withFilter().kinds([EventKind.ZapReceipt]).tag("p", [host]);
|
||||||
rb.withFilter()
|
}
|
||||||
.kinds([EventKind.ZapReceipt])
|
|
||||||
.tag("a", [aTag]);
|
|
||||||
return rb;
|
return rb;
|
||||||
}, [link]);
|
}, [link, host]);
|
||||||
|
|
||||||
const feed = useRequestBuilder<FlatNoteStore>(System, FlatNoteStore, sub);
|
const feed = useRequestBuilder<FlatNoteStore>(System, FlatNoteStore, sub);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user