address test errors

This commit is contained in:
lemonknowsall committed 2025-10-06 00:15:20 -07:00
1 parent 6dacd3d964
commit af1cbaeacc
3 files changed
+132 -122

No files matched your search

+7 -7
View File
@@ -1,4 +1,4 @@
import { useState, useEffect } from 'react';
import { useState, useEffect, useCallback } from 'react';
import { useCashu, type HistoryEntry } from '@/hooks/useCashu';
import { useLocalStorage } from '@/hooks/useLocalStorage';
import { useLightningAddress } from '@/hooks/useLightningAddress';
@@ -8,7 +8,7 @@ import { Card, CardContent, CardDescription, CardHeader, CardTitle } from '@/com
import { Alert, AlertDescription } from '@/components/ui/alert';
import { Badge } from '@/components/ui/badge';
import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuLabel, DropdownMenuSeparator, DropdownMenuTrigger} from '@/components/ui/dropdown-menu';
import { Loader2, Wallet, Plus, Send, Download, Bitcoin, DollarSign, ArrowLeftRight, RefreshCw, Copy, Check, ChevronDown, History, ArrowUpRight, ArrowDownLeft, Zap, X, Coins, ChevronUp } from 'lucide-react';
import { Loader2, Wallet, Plus, Send, Download, Bitcoin, RefreshCw, Copy, Check, ChevronDown, History, ArrowUpRight, ArrowDownLeft, Zap, X, Coins, ChevronUp } from 'lucide-react';
export function CashuWallet() {
// ============================================================================
@@ -131,7 +131,7 @@ export function CashuWallet() {
// HELPER FUNCTIONS - History
// ============================================================================
const loadHistory = async () => {
const loadHistory = useCallback(async () => {
try {
setIsLoadingHistory(true);
const entries = await getHistory(50, 0);
@@ -141,7 +141,7 @@ export function CashuWallet() {
} finally {
setIsLoadingHistory(false);
}
};
}, [getHistory]);
const getHistoryIcon = (type: string) => {
switch (type) {
@@ -433,7 +433,7 @@ export function CashuWallet() {
// Group proofs by denomination
const denominations: { [key: number]: number } = {};
proofs.forEach((proof: any) => {
proofs.forEach((proof: { amount?: number }) => {
const amount = proof.amount || 0;
denominations[amount] = (denominations[amount] || 0) + 1;
});
@@ -477,7 +477,7 @@ export function CashuWallet() {
if (isInitialized && historyEntries.length === 0) {
loadHistory();
}
}, [isInitialized]);
}, [isInitialized, historyEntries.length, loadHistory]);
// ============================================================================
// RENDER - Loading State
@@ -577,7 +577,7 @@ export function CashuWallet() {
onClick={() => setActiveMintUrl(mint.url)}
>
<div className="flex items-center gap-2">
<span className="font-medium">{getCleanMintLabel(mint as any)}</span>
<span className="font-medium">{getCleanMintLabel(mint)}</span>
</div>
</DropdownMenuItem>
))}