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:
@@ -77,6 +77,9 @@ export default class AddReimbursementComponent extends Component {
|
|||||||
if (this.exchangeRates.btcusd > 0 && this.totalUSD > 0) {
|
if (this.exchangeRates.btcusd > 0 && this.totalUSD > 0) {
|
||||||
btcAmount += (this.totalUSD / this.exchangeRates.btcusd);
|
btcAmount += (this.totalUSD / this.exchangeRates.btcusd);
|
||||||
}
|
}
|
||||||
|
if (this.totalUSD === 0 && this.totalEUR === 0) {
|
||||||
|
btcAmount = 0;
|
||||||
|
}
|
||||||
|
|
||||||
this.total = btcAmount.toFixed(8);
|
this.total = btcAmount.toFixed(8);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user