From 03782f8aea043042aaa069de0b91cdb80fbb4679 Mon Sep 17 00:00:00 2001
From: Florian Dold <florian.dold@gmail.com>
Date: Sun, 15 Oct 2017 18:30:02 +0200
Subject: derive history from db instead of storing it

---
 src/webex/pages/refund.tsx | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

(limited to 'src/webex/pages/refund.tsx')

diff --git a/src/webex/pages/refund.tsx b/src/webex/pages/refund.tsx
index d2c21c2f4..73bed30ee 100644
--- a/src/webex/pages/refund.tsx
+++ b/src/webex/pages/refund.tsx
@@ -63,10 +63,12 @@ const RefundDetail = ({purchase, fullRefundFees}: {purchase: types.PurchaseRecor
     amountDone = types.Amounts.add(amountDone, purchase.refundsDone[k].refund_amount).amount;
   }
 
+  const hasPending = amountPending.fraction !== 0 || amountPending.value !== 0;
+
   return (
     <div>
-      <p>Refund fully received: <AmountDisplay amount={amountDone} /> (refund fees: <AmountDisplay amount={fullRefundFees} />)</p>
-      <p>Refund incoming: <AmountDisplay amount={amountPending} /></p>
+      {hasPending ? <p>Refund pending: <AmountDisplay amount={amountPending} /></p> : null}
+      <p>Refund received: <AmountDisplay amount={amountDone} /> (refund fees: <AmountDisplay amount={fullRefundFees} />)</p>
     </div>
   );
 };
-- 
cgit v1.2.3

