bug: profile zaps

This commit is contained in:
Kieran 2023-02-04 22:43:04 +00:00
parent 6d7892ac66
commit 1458611fc7
Signed by: Kieran
GPG Key ID: DE71CEB3925BE941
3 changed files with 3 additions and 3 deletions

View File

@ -35,7 +35,7 @@ export default function useTimelineFeed(subject: TimelineSubject, options: Timel
let sub = new Subscriptions();
sub.Id = `timeline:${subject.type}:${subject.discriminator}`;
sub.Kinds = new Set([EventKind.TextNote, EventKind.Repost, EventKind.ZapReceipt]);
sub.Kinds = new Set([EventKind.TextNote, EventKind.Repost]);
switch (subject.type) {
case "pubkey": {
sub.Authors = new Set(subject.items);

View File

@ -7,7 +7,7 @@ import useSubscription from "./Subscription";
export default function useZapsFeed(pubkey: HexKey) {
const sub = useMemo(() => {
let x = new Subscriptions();
x.Id = `zaps:${pubkey}`;
x.Id = `zaps:${pubkey.slice(0, 12)}`;
x.Kinds = new Set([EventKind.ZapReceipt]);
x.PTags = new Set([pubkey]);
return x;

View File

@ -67,7 +67,7 @@ export default function ProfilePage() {
const profileZaps = zapFeed.store.notes.map(parseZap).filter(z => z.valid && z.p === id && !z.e && z.zapper !== id)
profileZaps.sort((a, b) => b.amount - a.amount)
return profileZaps
}, [zapFeed.store.notes, id])
}, [zapFeed.store, id])
const zapsTotal = zaps.reduce((acc, z) => acc + z.amount, 0)
useEffect(() => {