From ccda6ec354eb82920b626b44472f72604647ad38 Mon Sep 17 00:00:00 2001 From: Sebastian Kippe Date: Sat, 31 Oct 2020 12:58:03 +0100 Subject: [PATCH] Reset BTC amount to 0 when last expense item removed Fix a logical bug that prevented setting the amount to 0 upon removing the last item from the list/form. --- app/components/add-reimbursement/component.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/components/add-reimbursement/component.js b/app/components/add-reimbursement/component.js index 2bf8c74..a379a28 100644 --- a/app/components/add-reimbursement/component.js +++ b/app/components/add-reimbursement/component.js @@ -77,6 +77,9 @@ export default class AddReimbursementComponent extends Component { if (this.exchangeRates.btcusd > 0 && this.totalUSD > 0) { btcAmount += (this.totalUSD / this.exchangeRates.btcusd); } + if (this.totalUSD === 0 && this.totalEUR === 0) { + btcAmount = 0; + } this.total = btcAmount.toFixed(8); }