fix note collections
Some checks failed
Release / tauri_release (macos-latest) (push) Has been cancelled
Release / tauri_release (ubuntu-20.04) (push) Has been cancelled
Release / tauri_release (windows-latest) (push) Has been cancelled

This commit is contained in:
2023-07-04 11:33:40 +01:00
parent 6851fe0b2b
commit 7c2340d7fb
6 changed files with 13 additions and 35 deletions

View File

@ -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) {