fix: filter goals by host
This commit is contained in:
@ -29,6 +29,9 @@ export function NewGoalDialog({ link }: NewGoalDialogProps) {
|
|||||||
.tag(["a", `${link.kind}:${link.author}:${link.id}`])
|
.tag(["a", `${link.kind}:${link.author}:${link.id}`])
|
||||||
.tag(["amount", String(Number(goalAmount) * 1000)])
|
.tag(["amount", String(Number(goalAmount) * 1000)])
|
||||||
.content(goalName);
|
.content(goalName);
|
||||||
|
if (link.relays?.length) {
|
||||||
|
eb.tag(["relays", ...link.relays]);
|
||||||
|
}
|
||||||
return eb;
|
return eb;
|
||||||
});
|
});
|
||||||
console.debug(evNew);
|
console.debug(evNew);
|
||||||
|
@ -11,15 +11,16 @@ import { GOAL } from "const";
|
|||||||
import { System } from "index";
|
import { System } from "index";
|
||||||
import { findTag } from "utils";
|
import { findTag } from "utils";
|
||||||
|
|
||||||
export function useZapGoal(link: NostrLink, leaveOpen = false) {
|
export function useZapGoal(host: string, link: NostrLink, leaveOpen = false) {
|
||||||
const sub = useMemo(() => {
|
const sub = useMemo(() => {
|
||||||
const b = new RequestBuilder(`goals:${link.author!.slice(0, 12)}`);
|
const b = new RequestBuilder(`goals:${host.slice(0, 12)}`);
|
||||||
b.withOptions({ leaveOpen });
|
b.withOptions({ leaveOpen });
|
||||||
b.withFilter()
|
b.withFilter()
|
||||||
.kinds([GOAL])
|
.kinds([GOAL])
|
||||||
|
.authors([host])
|
||||||
.tag("a", [`${link.kind}:${link.author!}:${link.id}`]);
|
.tag("a", [`${link.kind}:${link.author!}:${link.id}`]);
|
||||||
return b;
|
return b;
|
||||||
}, [link]);
|
}, [link, leaveOpen]);
|
||||||
|
|
||||||
const { data } = useRequestBuilder<NoteCollection>(
|
const { data } = useRequestBuilder<NoteCollection>(
|
||||||
System,
|
System,
|
||||||
|
@ -108,7 +108,8 @@ export function StreamPage() {
|
|||||||
const params = useParams();
|
const params = useParams();
|
||||||
const link = parseNostrLink(params.id!);
|
const link = parseNostrLink(params.id!);
|
||||||
const { data: ev } = useEventFeed(link, true);
|
const { data: ev } = useEventFeed(link, true);
|
||||||
const goal = useZapGoal(link, true);
|
const host = getHost(ev);
|
||||||
|
const goal = useZapGoal(host, link, true);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
|
Reference in New Issue
Block a user