@@ -16,6 +16,7 @@ import ReceiveDialog from "./cashu/ReceiveDialog"
1616import  QRScannerModal  from  "./cashu/QRScannerModal" 
1717import  HistoryList  from  "./cashu/HistoryList" 
1818import  MintsList  from  "./cashu/MintsList" 
19+ import  TransactionDetailsModal  from  "./cashu/TransactionDetailsModal" 
1920import  { formatUsd }  from  "./cashu/utils" 
2021import  { Link ,  useNavigate ,  useLocation }  from  "@/navigation" 
2122import  Header  from  "@/shared/components/header/Header" 
@@ -79,6 +80,10 @@ export default function CashuWallet() {
7980  const  [ receiveDialogInitialToken ,  setReceiveDialogInitialToken ]  =  useState < string > ( "" ) 
8081  const  [ receiveDialogInitialInvoice ,  setReceiveDialogInitialInvoice ]  =  useState < string > ( "" ) 
8182  const  [ refreshing ,  setRefreshing ]  =  useState ( false ) 
83+   const  [ showTransactionDetails ,  setShowTransactionDetails ]  =  useState ( false ) 
84+   const  [ selectedTransaction ,  setSelectedTransaction ]  =  useState < EnrichedHistoryEntry  |  null > ( 
85+     null 
86+   ) 
8287  const  [ qrError ,  setQrError ]  =  useState < string > ( "" ) 
8388  const  [ isOffline ,  setIsOffline ]  =  useState ( ! navigator . onLine ) 
8489  const  [ showToS ,  setShowToS ]  =  useState ( false ) 
@@ -208,6 +213,11 @@ export default function CashuWallet() {
208213    } 
209214  } ,  [ ] ) 
210215
216+   const  handleReceiveEntryClick  =  useCallback ( ( entry : HistoryEntry )  =>  { 
217+     setSelectedTransaction ( entry  as  EnrichedHistoryEntry ) 
218+     setShowTransactionDetails ( true ) 
219+   } ,  [ ] ) 
220+ 
211221  const  handleCloseSendDialog  =  ( )  =>  { 
212222    setShowSendDialog ( false ) 
213223    setSendDialogInitialToken ( undefined ) 
@@ -224,7 +234,34 @@ export default function CashuWallet() {
224234    console . log ( "🔄 Manual refresh button clicked" ) 
225235    setRefreshing ( true ) 
226236    try  { 
227-       // Check pending melt quotes (for stuck Lightning payments) 
237+       // Check and redeem pending mint quotes (for stuck incoming Lightning payments) 
238+       if  ( manager )  { 
239+         console . log ( "🔍 Checking and requeueing paid mint quotes" ) 
240+         try  { 
241+           const  result  =  await  manager . quotes . requeuePaidMintQuotes ( ) 
242+           console . log ( `✅ Requeued ${ result . requeued . length }  ) 
243+           if  ( result . requeued . length  >  0 )  { 
244+             console . log ( "⏳ Waiting for quotes to be processed..." ) 
245+             // Give processor time to redeem quotes 
246+             await  new  Promise ( ( resolve )  =>  setTimeout ( resolve ,  3000 ) ) 
247+           } 
248+         }  catch  ( err )  { 
249+           console . error ( "Failed to requeue mint quotes:" ,  err ) 
250+         } 
251+ 
252+         // Force recalculate balance from all proofs in database 
253+         // This catches any old redeemed quotes that weren't reflected in balance 
254+         console . log ( "🔍 Recalculating balance from all proofs" ) 
255+         try  { 
256+           const  freshBalance  =  await  manager . wallet . getBalances ( ) 
257+           console . log ( "💰 Fresh balance:" ,  freshBalance ) 
258+           setBalance ( freshBalance ) 
259+         }  catch  ( err )  { 
260+           console . error ( "Failed to recalculate balance:" ,  err ) 
261+         } 
262+       } 
263+ 
264+       // Check pending melt quotes (for stuck outgoing Lightning payments) 
228265      if  ( manager  &&  balance )  { 
229266        const  mints  =  Object . keys ( balance ) 
230267        console . log ( "🔍 Checking pending melt quotes on mints:" ,  mints ) 
@@ -464,6 +501,7 @@ export default function CashuWallet() {
464501          mgr . on ( "receive:created" ,  ( )  =>  updateData ( "receive:created" ) ) , 
465502          mgr . on ( "mint-quote:created" ,  ( )  =>  updateData ( "mint-quote:created" ) ) , 
466503          mgr . on ( "mint-quote:redeemed" ,  ( )  =>  updateData ( "mint-quote:redeemed" ) ) , 
504+           mgr . on ( "proofs:saved" ,  ( )  =>  updateData ( "proofs:saved" ) ) , 
467505        ] 
468506
469507        return  ( )  =>  { 
@@ -571,7 +609,7 @@ export default function CashuWallet() {
571609            < button 
572610              onClick = { handleRefresh } 
573611              disabled = { refreshing } 
574-               className = "btn btn-circle btn-ghost btn-sm flex-shrink-0" 
612+               className = "btn btn-circle btn-ghost btn-sm flex-shrink-0 disabled:opacity-70 " 
575613              title = "Refresh" 
576614            > 
577615              < RiRefreshLine  className = { `w-5 h-5 ${ refreshing  ? "animate-spin"  : "" }  }  /> 
@@ -704,6 +742,7 @@ export default function CashuWallet() {
704742                        usdRate = { usdRate } 
705743                        onSendEntryClick = { handleSendEntryClick } 
706744                        onMintEntryClick = { handleMintEntryClick } 
745+                         onReceiveEntryClick = { handleReceiveEntryClick } 
707746                      /> 
708747                    </ div > 
709748                  ) } 
@@ -756,6 +795,16 @@ export default function CashuWallet() {
756795              onScanSuccess = { handleQRScanSuccess } 
757796            /> 
758797
798+             < TransactionDetailsModal 
799+               isOpen = { showTransactionDetails } 
800+               onClose = { ( )  =>  { 
801+                 setShowTransactionDetails ( false ) 
802+                 setSelectedTransaction ( null ) 
803+               } } 
804+               entry = { selectedTransaction } 
805+               usdRate = { usdRate } 
806+             /> 
807+ 
759808            { qrError  &&  ( 
760809              < div  className = "fixed bottom-24 left-1/2 -translate-x-1/2 z-50 max-w-md" > 
761810                < div  className = "alert alert-error" > 
0 commit comments