feat: @snort/system CacheRelay
This commit is contained in:
@ -1,5 +1,5 @@
|
||||
import { NostrLink, TaggedNostrEvent } from "@snort/system";
|
||||
import { useEventReactions } from "@snort/system-react";
|
||||
import { useEventReactions, useReactions } from "@snort/system-react";
|
||||
import React, { useMemo, useState } from "react";
|
||||
|
||||
import { FooterZapButton } from "@/Components/Event/Note/NoteFooter/FooterZapButton";
|
||||
@ -8,7 +8,6 @@ import { PowIcon } from "@/Components/Event/Note/NoteFooter/PowIcon";
|
||||
import { ReplyButton } from "@/Components/Event/Note/NoteFooter/ReplyButton";
|
||||
import { RepostButton } from "@/Components/Event/Note/NoteFooter/RepostButton";
|
||||
import ReactionsModal from "@/Components/Event/Note/ReactionsModal";
|
||||
import { useReactionsView } from "@/Feed/WorkerRelayView";
|
||||
import useLogin from "@/Hooks/useLogin";
|
||||
|
||||
export interface NoteFooterProps {
|
||||
@ -22,7 +21,7 @@ export default function NoteFooter(props: NoteFooterProps) {
|
||||
const ids = useMemo(() => [link], [link]);
|
||||
const [showReactions, setShowReactions] = useState(false);
|
||||
|
||||
const related = useReactionsView(ids, false);
|
||||
const related = useReactions("reactions", ids, undefined, false);
|
||||
const { reactions, zaps, reposts } = useEventReactions(link, related);
|
||||
const { positive } = reactions;
|
||||
|
||||
|
@ -21,19 +21,18 @@ export function LocalSearch({ term, kind }: { term: string; kind: EventKind }) {
|
||||
useEffect(() => {
|
||||
setFrag(undefined);
|
||||
if (term) {
|
||||
Relay.req({
|
||||
id: "local-search",
|
||||
filters: [
|
||||
{
|
||||
kinds: [kind],
|
||||
limit: 100,
|
||||
search: term,
|
||||
},
|
||||
],
|
||||
}).then(res => {
|
||||
Relay.query([
|
||||
"REQ",
|
||||
"local-search",
|
||||
{
|
||||
kinds: [kind],
|
||||
limit: 100,
|
||||
search: term,
|
||||
},
|
||||
]).then(res => {
|
||||
setFrag({
|
||||
refTime: 0,
|
||||
events: res.result as Array<TaggedNostrEvent>,
|
||||
events: res as Array<TaggedNostrEvent>,
|
||||
});
|
||||
});
|
||||
}
|
||||
|
Reference in New Issue
Block a user