fix build

This commit is contained in:
hzrd149
2024-05-04 13:38:50 -05:00
parent 3e5c34e3fe
commit 08b5503815
3 changed files with 9 additions and 4 deletions

View File

@@ -76,7 +76,7 @@ export default class BatchRelationLoader {
{ leading: false, trailing: true },
);
private handleEvent(event: NostrEvent) {
handleEvent(event: NostrEvent) {
// add event to cache
const updateIds = new Set<string>();
for (const tag of event.tags) {
@@ -93,7 +93,7 @@ export default class BatchRelationLoader {
for (const id of updateIds) this.onEventUpdate.next(id);
}
private handleEOSE() {
handleEOSE() {
// resolve all pending from the last request
for (const [uid, defer] of this.pending) {
defer.resolve(this.references.get(uid));

View File

@@ -58,7 +58,7 @@ class EventReactionsService {
requestReactions(eventUID: string, urls: Iterable<string | URL | AbstractRelay>, alwaysRequest = true) {
const subject = this.subjects.get(eventUID);
if (subject.value && !alwaysRequest) return;
if (subject.value && !alwaysRequest) return subject;
if (localRelay) {
this.loaders.get(localRelay as AbstractRelay).requestEvents(eventUID);
@@ -71,6 +71,11 @@ class EventReactionsService {
return subject;
}
handleEvent(event: NostrEvent) {
// pretend it came from the local relay
if (localRelay) this.loaders.get(localRelay as AbstractRelay).handleEvent(event);
}
}
const eventReactionsService = new EventReactionsService();

View File

@@ -58,7 +58,7 @@ class EventZapsService {
requestZaps(eventUID: string, urls: Iterable<string | URL | AbstractRelay>, alwaysRequest = true) {
const subject = this.subjects.get(eventUID);
if (subject.value && !alwaysRequest) return;
if (subject.value && !alwaysRequest) return subject;
if (localRelay) {
this.loaders.get(localRelay as AbstractRelay).requestEvents(eventUID);