Adjust zap goals & chat zaps

This commit is contained in:
2023-07-13 13:29:31 +01:00
parent 21c8d5c158
commit 7ae4cf5221
2 changed files with 10 additions and 8 deletions

View File

@ -66,7 +66,7 @@ export function LiveChat({
height?: number;
}) {
const host = getHost(ev);
const feed = useLiveChatFeed(link, host);
const feed = useLiveChatFeed(link, goal ? [goal.id] : undefined);
const login = useLogin();
useEffect(() => {
const pubkeys = [
@ -81,7 +81,7 @@ export function LiveChat({
.filter((z) => z && z.valid);
const goalZaps = feed.zaps
.filter((ev) => (goal ? ev.created_at > goal.created_at : false))
.filter((ev) => (goal ? ev.created_at > goal.created_at && ev.tags.some(t => t[0] === "e" && t[1] === goal.id) : false))
.map((ev) => parseZap(ev, System.ProfileLoader.Cache))
.filter((z) => z && z.valid);
@ -124,7 +124,7 @@ export function LiveChat({
<div className="top-zappers-container">
<TopZappers zaps={zaps} />
</div>
{goal && <Goal link={link} ev={goal} zaps={goalZaps} /> }
{goal && <Goal link={link} ev={goal} zaps={goalZaps} />}
{login?.pubkey === streamer && <NewGoalDialog link={link} />}
</div>
)}