refactor: reactions grouping and other fixes
This commit is contained in:
@ -36,8 +36,8 @@ export default function NoteFooter(props: NoteFooterProps) {
|
||||
const link = useMemo(() => NostrLink.fromEvent(ev), [ev.id]);
|
||||
const ids = useMemo(() => [link], [link]);
|
||||
|
||||
const related = useReactions(link.id + "related", ids, undefined, false);
|
||||
const { reactions, zaps, reposts } = useEventReactions(link, related.data ?? []);
|
||||
const related = useReactions("note:reactions", ids, undefined, false);
|
||||
const { reactions, zaps, reposts } = useEventReactions(link, related);
|
||||
const { positive } = reactions;
|
||||
|
||||
const { formatMessage } = useIntl();
|
||||
|
@ -11,11 +11,11 @@ const options = {
|
||||
|
||||
export default function NoteQuote({ link, depth }: { link: NostrLink; depth?: number }) {
|
||||
const ev = useEventFeed(link);
|
||||
if (!ev.data)
|
||||
if (!ev)
|
||||
return (
|
||||
<div className="note-quote flex items-center justify-center h-[110px]">
|
||||
<PageSpinner />
|
||||
</div>
|
||||
);
|
||||
return <Note data={ev.data} className="note-quote" depth={(depth ?? 0) + 1} options={options} />;
|
||||
return <Note data={ev} className="note-quote" depth={(depth ?? 0) + 1} options={options} />;
|
||||
}
|
||||
|
@ -26,11 +26,11 @@ const ReactionsModal = ({ show, setShow, event }: ReactionsModalProps) => {
|
||||
|
||||
const link = NostrLink.fromEvent(event);
|
||||
|
||||
const related = useReactions(link.id + "related", [link], undefined, false);
|
||||
const { reactions, zaps, reposts } = useEventReactions(link, related.data ?? []);
|
||||
const related = useReactions("note:reactions", [link], undefined, false);
|
||||
const { reactions, zaps, reposts } = useEventReactions(link, related);
|
||||
const { positive, negative } = reactions;
|
||||
|
||||
const sortEvents = events =>
|
||||
const sortEvents = (events: Array<TaggedNostrEvent>) =>
|
||||
events.sort(
|
||||
(a, b) => socialGraphInstance.getFollowDistance(a.pubkey) - socialGraphInstance.getFollowDistance(b.pubkey),
|
||||
);
|
||||
|
Reference in New Issue
Block a user