From aba5fce6d26f9a55c8f2513dd6e8562c4005b490 Mon Sep 17 00:00:00 2001 From: yaannko Date: Tue, 16 Dec 2025 02:19:53 +0530 Subject: [PATCH] chore: Remove debug console logs and warnings, and adjust formatting for token address and amount display. --- frontend/src/page/SentInvoice.jsx | 27 ++++++++++++--------------- 1 file changed, 12 insertions(+), 15 deletions(-) diff --git a/frontend/src/page/SentInvoice.jsx b/frontend/src/page/SentInvoice.jsx index bbe2351..8e8bede 100644 --- a/frontend/src/page/SentInvoice.jsx +++ b/frontend/src/page/SentInvoice.jsx @@ -173,10 +173,10 @@ function SentInvoice() { ); const res = await contract.getSentInvoices(address); - console.log("Raw invoices data:", res); + if (!res || !Array.isArray(res) || res.length === 0) { - console.warn("No invoices found."); + setSentInvoices([]); setLoading(false); return; @@ -198,7 +198,6 @@ function SentInvoice() { const currentUserAddress = address.toLowerCase(); if (currentUserAddress !== from && currentUserAddress !== to) { - console.warn(`Unauthorized access attempt for invoice ${id}`); continue; } @@ -335,7 +334,6 @@ function SentInvoice() { console.error("Decryption error:", error); setError("Failed to fetch invoices. Please try again."); } finally { - console.log(sentInvoices); setLoading(false); } }; @@ -889,11 +887,11 @@ function SentInvoice() {

{drawerState.selectedInvoice.paymentToken?.address ? `${drawerState.selectedInvoice.paymentToken.address.substring( - 0, - 10 - )}......${drawerState.selectedInvoice.paymentToken.address.substring( - 33 - )}` + 0, + 10 + )}......${drawerState.selectedInvoice.paymentToken.address.substring( + 33 + )}` : "Native Currency"}

@@ -979,12 +977,11 @@ function SentInvoice() { {drawerState.selectedInvoice.paymentToken?.symbol === "ETH" ? `${( - parseFloat(drawerState.selectedInvoice.amountDue) + - parseFloat(ethers.formatUnits(fee)) - ).toFixed(6)} ETH` - : `${drawerState.selectedInvoice.amountDue} ${ - drawerState.selectedInvoice.paymentToken?.symbol - } + ${ethers.formatUnits(fee)} ETH`} + parseFloat(drawerState.selectedInvoice.amountDue) + + parseFloat(ethers.formatUnits(fee)) + ).toFixed(6)} ETH` + : `${drawerState.selectedInvoice.amountDue} ${drawerState.selectedInvoice.paymentToken?.symbol + } + ${ethers.formatUnits(fee)} ETH`}