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.
This commit is contained in:
2020-10-31 12:58:03 +01:00
parent 2045b94951
commit ccda6ec354
@@ -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);
}