fix note collections
This commit is contained in:
parent
6851fe0b2b
commit
7c2340d7fb
@ -1,5 +1,5 @@
|
||||
import { useMemo } from "react";
|
||||
import { HexKey, EventKind, PubkeyReplaceableNoteStore, RequestBuilder } from "@snort/system";
|
||||
import { HexKey, EventKind, NoteCollection, RequestBuilder } from "@snort/system";
|
||||
import { useRequestBuilder } from "@snort/system-react";
|
||||
import { System } from "index";
|
||||
|
||||
@ -11,7 +11,7 @@ export default function useFollowersFeed(pubkey?: HexKey) {
|
||||
return b;
|
||||
}, [pubkey]);
|
||||
|
||||
const followersFeed = useRequestBuilder<PubkeyReplaceableNoteStore>(System, PubkeyReplaceableNoteStore, sub);
|
||||
const followersFeed = useRequestBuilder<NoteCollection>(System, NoteCollection, sub);
|
||||
|
||||
const followers = useMemo(() => {
|
||||
const contactLists = followersFeed.data?.filter(
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { useMemo } from "react";
|
||||
import { HexKey, TaggedRawEvent, EventKind, PubkeyReplaceableNoteStore, RequestBuilder } from "@snort/system";
|
||||
import { HexKey, TaggedRawEvent, EventKind, NoteCollection, RequestBuilder } from "@snort/system";
|
||||
import { useRequestBuilder } from "@snort/system-react";
|
||||
|
||||
import useLogin from "Hooks/useLogin";
|
||||
@ -16,7 +16,7 @@ export default function useFollowsFeed(pubkey?: HexKey) {
|
||||
return b;
|
||||
}, [isMe, pubkey]);
|
||||
|
||||
const contactFeed = useRequestBuilder<PubkeyReplaceableNoteStore>(System, PubkeyReplaceableNoteStore, sub);
|
||||
const contactFeed = useRequestBuilder<NoteCollection>(System, NoteCollection, sub);
|
||||
return useMemo(() => {
|
||||
if (isMe) {
|
||||
return follows.item;
|
||||
|
@ -1,12 +1,5 @@
|
||||
import { useMemo } from "react";
|
||||
import {
|
||||
HexKey,
|
||||
TaggedRawEvent,
|
||||
Lists,
|
||||
EventKind,
|
||||
ParameterizedReplaceableNoteStore,
|
||||
RequestBuilder,
|
||||
} from "@snort/system";
|
||||
import { HexKey, TaggedRawEvent, Lists, EventKind, NoteCollection, RequestBuilder } from "@snort/system";
|
||||
import { useRequestBuilder } from "@snort/system-react";
|
||||
|
||||
import { getNewest } from "SnortUtils";
|
||||
@ -24,11 +17,7 @@ export default function useMutedFeed(pubkey?: HexKey) {
|
||||
return b;
|
||||
}, [pubkey]);
|
||||
|
||||
const mutedFeed = useRequestBuilder<ParameterizedReplaceableNoteStore>(
|
||||
System,
|
||||
ParameterizedReplaceableNoteStore,
|
||||
sub
|
||||
);
|
||||
const mutedFeed = useRequestBuilder<NoteCollection>(System, NoteCollection, sub);
|
||||
|
||||
const mutedList = useMemo(() => {
|
||||
if (pubkey && mutedFeed.data) {
|
||||
|
@ -5,7 +5,7 @@ import {
|
||||
TaggedRawEvent,
|
||||
RelaySettings,
|
||||
EventKind,
|
||||
PubkeyReplaceableNoteStore,
|
||||
NoteCollection,
|
||||
RequestBuilder,
|
||||
} from "@snort/system";
|
||||
import { useRequestBuilder } from "@snort/system-react";
|
||||
@ -80,7 +80,7 @@ export default function useRelaysFeedFollows(pubkeys: HexKey[]): Array<RelayList
|
||||
});
|
||||
}
|
||||
|
||||
const relays = useRequestBuilder<PubkeyReplaceableNoteStore>(System, PubkeyReplaceableNoteStore, sub);
|
||||
const relays = useRequestBuilder<NoteCollection>(System, NoteCollection, sub);
|
||||
const notesRelays = relays.data?.filter(a => a.kind === EventKind.Relays) ?? [];
|
||||
const notesContactLists = relays.data?.filter(a => a.kind === EventKind.ContactList) ?? [];
|
||||
return useMemo(() => {
|
||||
|
@ -1,12 +1,5 @@
|
||||
import { useMemo } from "react";
|
||||
import {
|
||||
HexKey,
|
||||
Lists,
|
||||
EventKind,
|
||||
FlatNoteStore,
|
||||
ParameterizedReplaceableNoteStore,
|
||||
RequestBuilder,
|
||||
} from "@snort/system";
|
||||
import { HexKey, Lists, EventKind, FlatNoteStore, NoteCollection, RequestBuilder } from "@snort/system";
|
||||
import { useRequestBuilder } from "@snort/system-react";
|
||||
|
||||
import useLogin from "Hooks/useLogin";
|
||||
@ -24,11 +17,7 @@ export default function useNotelistSubscription(pubkey: HexKey | undefined, l: L
|
||||
return rb;
|
||||
}, [pubkey]);
|
||||
|
||||
const listStore = useRequestBuilder<ParameterizedReplaceableNoteStore>(
|
||||
System,
|
||||
ParameterizedReplaceableNoteStore,
|
||||
sub
|
||||
);
|
||||
const listStore = useRequestBuilder<NoteCollection>(System, NoteCollection, sub);
|
||||
const etags = useMemo(() => {
|
||||
if (isMe) return defaultIds;
|
||||
// there should only be a single event here because we only load 1 pubkey
|
||||
|
@ -1,7 +1,7 @@
|
||||
|
||||
import debug from "debug";
|
||||
import { unixNowMs, FeedCache } from "@snort/shared";
|
||||
import { EventKind, HexKey, SystemInterface, TaggedRawEvent, PubkeyReplaceableNoteStore, RequestBuilder } from ".";
|
||||
import { EventKind, HexKey, SystemInterface, TaggedRawEvent, NoteCollection, RequestBuilder } from ".";
|
||||
import { ProfileCacheExpire } from "./const";
|
||||
import { mapEventToProfile, MetadataCache } from "./cache";
|
||||
|
||||
@ -94,8 +94,8 @@ export class ProfileLoaderService {
|
||||
MetadataRelays.forEach(r => fMissing.relay(r));
|
||||
}
|
||||
const newProfiles = new Set<string>();
|
||||
const q = this.#system.Query<PubkeyReplaceableNoteStore>(PubkeyReplaceableNoteStore, sub);
|
||||
const feed = (q?.feed as PubkeyReplaceableNoteStore) ?? new PubkeyReplaceableNoteStore();
|
||||
const q = this.#system.Query<NoteCollection>(NoteCollection, sub);
|
||||
const feed = (q?.feed as NoteCollection) ?? new NoteCollection();
|
||||
// never release this callback, it will stop firing anyway after eose
|
||||
const releaseOnEvent = feed.onEvent(async e => {
|
||||
for (const pe of e) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user