diff --git a/src/components/ZapWindow.tsx b/src/components/ZapWindow.tsx index 002a23b..892adc3 100644 --- a/src/components/ZapWindow.tsx +++ b/src/components/ZapWindow.tsx @@ -11,7 +11,7 @@ * - Shows feed render of zapped event */ -import { useState, useMemo, useEffect, useRef } from "react"; +import { useState, useMemo, useRef } from "react"; import { toast } from "sonner"; import { Zap, @@ -118,17 +118,7 @@ export function ZapWindow({ const activeAccount = accountManager.active; const canSign = !!activeAccount?.signer; - 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 { wallet, payInvoice, refreshBalance, walletMethods } = useWallet(); // Cache LNURL data for recipient's Lightning address const { data: lnurlData } = useLnurlCache(recipientProfile?.lud16); @@ -399,7 +389,7 @@ export function ZapWindow({ setInvoice(invoiceText); // Step 5: Pay or show QR code - if (useWallet && wallet && walletInfo?.methods.includes("pay_invoice")) { + if (useWallet && wallet && walletMethods.includes("pay_invoice")) { // Pay with NWC wallet with timeout setIsPayingWithWallet(true); try { @@ -567,7 +557,7 @@ export function ZapWindow({ {/* Retry with wallet button if payment failed/timed out */} {paymentTimedOut && wallet && - walletInfo?.methods.includes("pay_invoice") && ( + walletMethods.includes("pay_invoice") && (