From 677ca771c84e7c19018b5e6d70997527f6aef54e Mon Sep 17 00:00:00 2001 From: Alejandro Gomez Date: Sat, 4 Feb 2023 00:45:04 +0100 Subject: [PATCH] don't show yourself as zap target --- src/Element/Zap.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Element/Zap.tsx b/src/Element/Zap.tsx index 896f2244..ffaf012b 100644 --- a/src/Element/Zap.tsx +++ b/src/Element/Zap.tsx @@ -1,5 +1,6 @@ import "./Zap.css"; import { useMemo } from "react"; +import { useSelector } from "react-redux"; // @ts-expect-error import { decode as invoiceDecode } from "light-bolt11-decoder"; import { bytesToHex } from "@noble/hashes/utils"; @@ -10,6 +11,7 @@ import { HexKey, TaggedRawEvent } from "Nostr"; import Event from "Nostr/Event"; import Text from "Element/Text"; import ProfileImage from "Element/ProfileImage"; +import { RootState } from "State/Store"; function findTag(e: TaggedRawEvent, tag: string) { const maybeTag = e.tags.find((evTag) => { @@ -80,12 +82,13 @@ export function parseZap(zap: TaggedRawEvent): ParsedZap { const Zap = ({ zap }: { zap: ParsedZap }) => { const { amount, content, zapper, valid, p } = zap + const pubKey = useSelector((s: RootState) => s.login.publicKey) return valid ? (
{zapper && } - + {p !== pubKey && }
{formatShort(amount)} sats