address testing errors

This commit is contained in:
lemonknowsall committed 2025-10-20 22:58:42 -07:00
1 parent 460a4777ee
commit 61fc4957e0
15 files changed
+45 -88

No files matched your search

+1 -1
View File
@@ -1,5 +1,5 @@
import { useState } from 'react';
import { User, UserPlus } from 'lucide-react';
import { User } from 'lucide-react';
import { Button } from '@/components/ui/button';
import LoginDialog from './LoginDialog';
import SignupDialog from './SignupDialog';
+2 -18
View File
@@ -37,7 +37,6 @@ export function CashuWallet() {
balances,
mints,
getEncodedToken,
clearError,
refreshMints,
} = useCashu();
@@ -55,8 +54,6 @@ export function CashuWallet() {
const {
setMint: setNpubCashMint,
getUserInfo: getNpubCashUserInfo,
getAllQuotes,
refreshQuotes,
syncQuotesWithWallet,
isLoggedIn: isNpubCashLoggedIn,
isLoading: isNpubCashLoading,
@@ -84,7 +81,6 @@ export function CashuWallet() {
handleRemoveMintClick,
handleConfirmRemoveMint,
mintToRemove,
setMintToRemove,
showRemoveMintModal,
setShowRemoveMintModal,
getCleanMintLabel,
@@ -96,7 +92,6 @@ export function CashuWallet() {
isNpubCashLoggedIn,
setNpubCashMint: handleSetNpubCashMint,
refreshMints,
toast,
});
// Wrapper for setActiveMintUrl to handle the async nature
@@ -129,7 +124,6 @@ export function CashuWallet() {
showInvoiceModal,
setShowInvoiceModal,
currentInvoice,
setCurrentInvoice,
handleReceive,
handleSend,
handleConfirmInvoicePayment,
@@ -137,10 +131,7 @@ export function CashuWallet() {
} = useWalletTransactions({
coco,
activeMintUrl,
isNpubCashLoggedIn,
repositories,
generateQRCode,
toast,
getEncodedToken,
getLightningInvoice,
});
@@ -148,8 +139,6 @@ export function CashuWallet() {
const {
historyEntries,
isLoadingHistory,
isHistoryExpanded,
setIsHistoryExpanded,
} = useHistoryManager({
coco,
isInitialized,
@@ -167,8 +156,6 @@ export function CashuWallet() {
denominations: { [key: number]: number };
totalBalance: number;
} | null>(null);
const [showLightningQR, setShowLightningQR] = useState(false);
const [lightningQRCode, setLightningQRCode] = useState<string>('');
const [showLightningAddressQR, setShowLightningAddressQR] = useState(false);
const [lightningAddressQRCode, setLightningAddressQRCode] = useState<string>('');
const [npubCashUserInfo, setNpubCashUserInfo] = useState<NpubCashUserInfo | null>(null);
@@ -272,7 +259,7 @@ export function CashuWallet() {
toast({
title: "Bitcoin Sent!",
description: `Transaction ${txId.slice(0, 8)}... confirmed`,
description: `Transaction ${txId.slice(0, 8)}... confirmed (Fee: ${fee} sats)`,
});
// Reset form and refresh balance
@@ -390,7 +377,7 @@ export function CashuWallet() {
let unsubscribe: (() => void) | null = null;
const setupSync = async () => {
unsubscribe = await syncQuotesWithWallet(coco, toast);
unsubscribe = await syncQuotesWithWallet(coco);
};
setupSync();
@@ -505,9 +492,6 @@ export function CashuWallet() {
mintToRemove={mintToRemove}
onConfirmRemoveMint={handleConfirmRemoveMint}
isLoading={isLoading || isNpubCashLoading}
showLightningQR={showLightningQR}
setShowLightningQR={setShowLightningQR}
lightningQRCode={lightningQRCode}
showLightningAddressQR={showLightningAddressQR}
setShowLightningAddressQR={setShowLightningAddressQR}
lightningAddressQRCode={lightningAddressQRCode}
-16
View File
@@ -31,9 +31,6 @@ interface WalletModalProps {
isLoading: boolean;
// QR Modals
showLightningQR: boolean;
setShowLightningQR: (show: boolean) => void;
lightningQRCode: string;
showLightningAddressQR: boolean;
setShowLightningAddressQR: (show: boolean) => void;
lightningAddressQRCode: string;
@@ -66,9 +63,6 @@ export function WalletModals({
mintToRemove,
onConfirmRemoveMint,
isLoading,
showLightningQR,
setShowLightningQR,
lightningQRCode,
showLightningAddressQR,
setShowLightningAddressQR,
lightningAddressQRCode,
@@ -207,16 +201,6 @@ export function WalletModals({
)}
{/* QR Modals */}
<QRModal
isOpen={showLightningQR}
onClose={() => setShowLightningQR(false)}
title="Lightning Address QR Code"
description="Scan to send Lightning payments"
qrCodeUrl={lightningQRCode}
content={''}
icon="qr"
/>
<QRModal
isOpen={showLightningAddressQR}
onClose={() => setShowLightningAddressQR(false)}
+2 -20
View File
@@ -1,7 +1,7 @@
import { Button } from '@/components/ui/button';
import { Input } from '@/components/ui/input';
import { Slider } from '@/components/ui/slider';
import { Send, Download, ArrowRight, Zap, Loader2, X } from 'lucide-react';
import { Send, Download, ArrowRight, Zap, X } from 'lucide-react';
import { useState, useEffect } from 'react';
interface TransactionCardProps {
@@ -86,9 +86,6 @@ export function TransactionCard({
const [addressSliderValue, setAddressSliderValue] = useState([0]);
const [bitcoinSliderValue, setBitcoinSliderValue] = useState([0]);
// State to track which slider is being actively held
const [activeSlider, setActiveSlider] = useState<string | null>(null);
// Handle slider value changes and auto-submit at 100%
const handleInvoiceSliderChange = (value: number[]) => {
setInvoiceSliderValue(value);
@@ -111,15 +108,7 @@ export function TransactionCard({
}
};
// Reset sliders when states change
const resetSliders = () => {
setInvoiceSliderValue([0]);
setAddressSliderValue([0]);
};
// Handle slider release (reset on mouse/touch up)
const handleSliderMouseUp = (sliderId: string) => {
setActiveSlider(null);
// Reset the slider if it hasn't reached 100
if (sliderId === 'invoice' && invoiceSliderValue[0] !== 100) {
setInvoiceSliderValue([0]);
@@ -130,11 +119,7 @@ export function TransactionCard({
}
};
const handleSliderMouseDown = (sliderId: string) => {
setActiveSlider(sliderId);
};
// Reset sliders when pending states change
// Reset sliders when states change
useEffect(() => {
if (!pendingInvoice) {
setInvoiceSliderValue([0]);
@@ -266,7 +251,6 @@ export function TransactionCard({
<div className="mt-6">
<div className="relative w-full">
<div
onMouseDown={() => handleSliderMouseDown('bitcoin')}
onMouseUp={() => handleSliderMouseUp('bitcoin')}
onMouseLeave={() => handleSliderMouseUp('bitcoin')}
onTouchEnd={() => handleSliderMouseUp('bitcoin')}
@@ -352,7 +336,6 @@ export function TransactionCard({
<div className="mt-6">
<div className="relative">
<div
onMouseDown={() => handleSliderMouseDown('invoice')}
onMouseUp={() => handleSliderMouseUp('invoice')}
onMouseLeave={() => handleSliderMouseUp('invoice')}
onTouchEnd={() => handleSliderMouseUp('invoice')}
@@ -393,7 +376,6 @@ export function TransactionCard({
<div className="mt-6">
<div className="relative w-full">
<div
onMouseDown={() => handleSliderMouseDown('address')}
onMouseUp={() => handleSliderMouseUp('address')}
onMouseLeave={() => handleSliderMouseUp('address')}
onTouchEnd={() => handleSliderMouseUp('address')}
-2
View File
@@ -1,7 +1,5 @@
import { useState, useEffect } from 'react';
import { nip19 } from 'nostr-tools';
import { Zap, Coins, Copy, Check, QrCode, Link } from 'lucide-react';
import { Button } from '@/components/ui/button';
import { exchangeRateService } from '@/lib/exchangeRateService';
import { useToast } from '@/hooks/useToast';
import { LoginIcon } from '@/components/auth/LoginIcon';