This commit is contained in:
parent
aefe8a8210
commit
280a7eaac2
@ -4,7 +4,7 @@ import { findTag } from "./utils";
|
|||||||
import { EventExt } from "./event-ext";
|
import { EventExt } from "./event-ext";
|
||||||
import { NostrLink } from "./nostr-link";
|
import { NostrLink } from "./nostr-link";
|
||||||
import debug from "debug";
|
import debug from "debug";
|
||||||
import {LRUCache} from "lru-cache";
|
import { LRUCache } from "lru-cache";
|
||||||
|
|
||||||
const Log = debug("zaps");
|
const Log = debug("zaps");
|
||||||
const ParsedZapCache = new LRUCache<string, ParsedZap>({ max: 1000 });
|
const ParsedZapCache = new LRUCache<string, ParsedZap>({ max: 1000 });
|
||||||
|
@ -6,7 +6,7 @@ import { RelayHandler, NostrEvent } from "./types";
|
|||||||
// placeholder:
|
// placeholder:
|
||||||
const parseZap = (_zap: NostrEvent) => {
|
const parseZap = (_zap: NostrEvent) => {
|
||||||
return { event: null } as { event: null | NostrEvent };
|
return { event: null } as { event: null | NostrEvent };
|
||||||
}
|
};
|
||||||
|
|
||||||
const log = debug("getForYouFeed");
|
const log = debug("getForYouFeed");
|
||||||
|
|
||||||
@ -63,7 +63,8 @@ async function getMyReactedEvents(relay: RelayHandler, pubkey: string) {
|
|||||||
kinds: [1, 6, 7, 9735],
|
kinds: [1, 6, 7, 9735],
|
||||||
}) as NostrEvent[];
|
}) as NostrEvent[];
|
||||||
myEvents.forEach(ev => {
|
myEvents.forEach(ev => {
|
||||||
const targetEventId = ev.kind === 9735 ? parseZap(ev).event?.id : ev.tags.find((tag: string[]) => tag[0] === "e")?.[1];
|
const targetEventId =
|
||||||
|
ev.kind === 9735 ? parseZap(ev).event?.id : ev.tags.find((tag: string[]) => tag[0] === "e")?.[1];
|
||||||
if (targetEventId) {
|
if (targetEventId) {
|
||||||
myReactedEventIds.add(targetEventId);
|
myReactedEventIds.add(targetEventId);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user