From 189f1ca0b3a696a18d37acfece244d257eeedbdd Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 18 Jan 2026 20:12:15 +0000 Subject: [PATCH] fix: resolve TypeScript errors in ZapWindow - Remove unused imports (useEffect, isAddressableKind, NostrEvent) - Fix walletInfo access: fetch from getInfo() hook instead of direct property - Store wallet info in component state with useEffect - All TypeScript syntax errors resolved --- src/components/ZapWindow.tsx | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/src/components/ZapWindow.tsx b/src/components/ZapWindow.tsx index 52fda7b..bfcbae8 100644 --- a/src/components/ZapWindow.tsx +++ b/src/components/ZapWindow.tsx @@ -11,7 +11,7 @@ * - Shows feed render of zapped event */ -import { useState, useEffect, useMemo } from "react"; +import { useState, useMemo, useEffect } from "react"; import { toast } from "sonner"; import { Zap, @@ -43,8 +43,6 @@ import { getProfileContent } from "applesauce-core/helpers"; import { getDisplayName } from "@/lib/nostr-utils"; import { KindRenderer } from "./nostr/kinds"; import type { EventPointer, AddressPointer } from "@/lib/open-parser"; -import { isAddressableKind } from "applesauce-core/helpers"; -import type { NostrEvent } from "@/types/nostr"; export interface ZapWindowProps { /** Recipient pubkey (who receives the zap) */ @@ -83,7 +81,17 @@ export function ZapWindow({ const recipientProfile = useProfile(recipientPubkey, eventStore); - const { wallet, walletInfo, payInvoice, refreshBalance } = useWallet(); + const { wallet, payInvoice, refreshBalance, getInfo } = useWallet(); + + // Fetch wallet info + const [walletInfo, setWalletInfo] = useState(null); + useEffect(() => { + if (wallet) { + getInfo() + .then((info) => setWalletInfo(info)) + .catch((error) => console.error("Failed to get wallet info:", error)); + } + }, [wallet, getInfo]); const [selectedAmount, setSelectedAmount] = useState(null); const [customAmount, setCustomAmount] = useState("");