diff --git a/src/components/mainPage/landing.jsx b/src/components/mainPage/landing.jsx
index 4f0f7cc..7460073 100644
--- a/src/components/mainPage/landing.jsx
+++ b/src/components/mainPage/landing.jsx
@@ -14,14 +14,11 @@ const Details = () => {
// refresh the cart logo and amount of the cart
useEffect(() => {
-
let sub_total = cart.reduce((sum, it)=>{
console.log(it.price);
return it.price+sum
},0);
-
setTotal(sub_total);
-
console.log("effect", total)
},[cart, total]);
@@ -29,7 +26,7 @@ const Details = () => {
<>
{/* you can try 600011 in orderID */}
-
+
diff --git a/src/components/orders/orders.jsx b/src/components/orders/orders.jsx
index 6056b04..88c2a08 100644
--- a/src/components/orders/orders.jsx
+++ b/src/components/orders/orders.jsx
@@ -37,7 +37,7 @@ const invoiceShape = (order) => {
}
-const Orders = ({ orderID, setOrderID, invoice }) => {
+const Orders = ({ orderID, setOrderID, invoice, setInvoice }) => {
const orders = useGetOrders(orderID);
const [results, setOrder] = useSetOrder();
@@ -50,11 +50,13 @@ const Orders = ({ orderID, setOrderID, invoice }) => {
}, [results, setOrderID]); //didUpdate
useEffect(() => {
+ console.log("Invoice: ", invoice && invoiceShape(invoice));
if (invoice) {
- console.log("Invoice: ", invoiceShape(invoice));
+ // console.log("Invoice: ", invoiceShape(invoice));
setOrder(invoiceShape(invoice));
+ setInvoice(null);
}
- }, [invoice]); //missing dep warning
+ }, [invoice, setOrder, setInvoice]); //missing dep warning
const onClick = (event) => {
setOrder(sampleOrder);