bug: profile zaps
This commit is contained in:
@ -35,7 +35,7 @@ export default function useTimelineFeed(subject: TimelineSubject, options: Timel
|
|||||||
|
|
||||||
let sub = new Subscriptions();
|
let sub = new Subscriptions();
|
||||||
sub.Id = `timeline:${subject.type}:${subject.discriminator}`;
|
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) {
|
switch (subject.type) {
|
||||||
case "pubkey": {
|
case "pubkey": {
|
||||||
sub.Authors = new Set(subject.items);
|
sub.Authors = new Set(subject.items);
|
||||||
|
@ -7,7 +7,7 @@ import useSubscription from "./Subscription";
|
|||||||
export default function useZapsFeed(pubkey: HexKey) {
|
export default function useZapsFeed(pubkey: HexKey) {
|
||||||
const sub = useMemo(() => {
|
const sub = useMemo(() => {
|
||||||
let x = new Subscriptions();
|
let x = new Subscriptions();
|
||||||
x.Id = `zaps:${pubkey}`;
|
x.Id = `zaps:${pubkey.slice(0, 12)}`;
|
||||||
x.Kinds = new Set([EventKind.ZapReceipt]);
|
x.Kinds = new Set([EventKind.ZapReceipt]);
|
||||||
x.PTags = new Set([pubkey]);
|
x.PTags = new Set([pubkey]);
|
||||||
return x;
|
return x;
|
||||||
|
@ -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)
|
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)
|
profileZaps.sort((a, b) => b.amount - a.amount)
|
||||||
return profileZaps
|
return profileZaps
|
||||||
}, [zapFeed.store.notes, id])
|
}, [zapFeed.store, id])
|
||||||
const zapsTotal = zaps.reduce((acc, z) => acc + z.amount, 0)
|
const zapsTotal = zaps.reduce((acc, z) => acc + z.amount, 0)
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
Reference in New Issue
Block a user