fix: don't show self zaps on note summary
This commit is contained in:
parent
ec28a51148
commit
62ae180652
@ -51,7 +51,10 @@ export default function NoteFooter(props: NoteFooterProps) {
|
||||
const langNames = new Intl.DisplayNames([...window.navigator.languages], { type: "language" });
|
||||
const reactions = useMemo(() => getReactions(related, ev.Id, EventKind.Reaction), [related, ev]);
|
||||
const reposts = useMemo(() => getReactions(related, ev.Id, EventKind.Repost), [related, ev]);
|
||||
const zaps = useMemo(() => getReactions(related, ev.Id, EventKind.ZapReceipt).map(parseZap).filter(z => z.valid), [related]);
|
||||
const zaps = useMemo(() =>
|
||||
getReactions(related, ev.Id, EventKind.ZapReceipt).map(parseZap).filter(z => z.valid && z.zapper !== ev.PubKey),
|
||||
[related]
|
||||
);
|
||||
const zapTotal = zaps.reduce((acc, z) => acc + z.amount, 0)
|
||||
const didZap = zaps.some(a => a.zapper === login);
|
||||
const groupReactions = useMemo(() => {
|
||||
|
@ -123,6 +123,7 @@ export default function ProfilePage() {
|
||||
case ProfileTab.Zaps: {
|
||||
return (
|
||||
<div className="main-content">
|
||||
<h4>{formatShort(zapsTotal)} sats</h4>
|
||||
{zaps.map(z => <ZapElement showZapped={false} zap={z} />)}
|
||||
</div>
|
||||
)
|
||||
@ -182,9 +183,6 @@ export default function ProfilePage() {
|
||||
<>
|
||||
<IconButton onClick={() => setShowLnQr(true)}>
|
||||
<Zap width={14} height={16} />
|
||||
<span className="zap-amount">
|
||||
{zapsTotal > 0 && formatShort(zapsTotal)}
|
||||
</span>
|
||||
</IconButton>
|
||||
{!loggedOut && (
|
||||
<>
|
||||
|
Loading…
x
Reference in New Issue
Block a user