fix: timeline feed reactions
This commit is contained in:
parent
733fb6da30
commit
01af3a3a58
@ -1,11 +1,12 @@
|
||||
import { useCallback, useEffect, useMemo } from "react";
|
||||
import { EventKind, NoteCollection, RequestBuilder } from "@snort/system";
|
||||
import { EventKind, NostrLink, NoteCollection, RequestBuilder } from "@snort/system";
|
||||
import { useRequestBuilder } from "@snort/system-react";
|
||||
import { unixNow } from "@snort/shared";
|
||||
|
||||
import useTimelineWindow from "Hooks/useTimelineWindow";
|
||||
import useLogin from "Hooks/useLogin";
|
||||
import { SearchRelays } from "Const";
|
||||
import { useReactions } from "./Reactions";
|
||||
|
||||
export interface TimelineFeedOptions {
|
||||
method: "TIME_RANGE" | "LIMIT_UNTIL";
|
||||
@ -131,6 +132,7 @@ export default function useTimelineFeed(subject: TimelineSubject, options: Timel
|
||||
}, [pref.autoShowLatest, createBuilder]);
|
||||
|
||||
const latest = useRequestBuilder(NoteCollection, subRealtime);
|
||||
const reactions = useReactions(`${sub?.id}-reactions`, main.data?.map(a => NostrLink.fromEvent(a)) ?? []);
|
||||
|
||||
useEffect(() => {
|
||||
// clear store if changing relays
|
||||
@ -140,7 +142,7 @@ export default function useTimelineFeed(subject: TimelineSubject, options: Timel
|
||||
|
||||
return {
|
||||
main: main.data,
|
||||
related: [],
|
||||
related: reactions.data,
|
||||
latest: latest.data,
|
||||
loading: main.loading(),
|
||||
loadMore: () => {
|
||||
|
Loading…
x
Reference in New Issue
Block a user